The difference between apache pseudo static and iis pseudo static rules and configurations

  • 2020-05-06 12:07:00
  • OfStack

This article will summarize the difference between apache pseudo-static and iis pseudo-static, mainly to talk about some rules and configuration differences, later you can directly in iis pseudo-static conversion apache, and vice versa.

has a different mode when I open it The.htaccess configuration file for apache opens write mode with: RewriteEngine On.
Apache pseudo-static html(URL Rewrite) setup
phpma 1 opens the Apache configuration file httpd.conf.
phpma 2 remove the # before #LoadModule rewrite_module modules/mod_rewrite
phpma 3 is added to httpd.conf:


<IfModule mod_rewrite.c> 
RewriteEngine On 
#RewriteCond %{ENV:SCRIPT_URL} (?:index|dispbbs)[-0-9]+.html 
RewriteRule ^(.*?(?:index|dispbbs))-([-0-9]+).html$ $1.php? 
__is_apache_rewrite=1&__rewrite_arg=$2 
</IfModule>

The httpd.ini configuration file for iis opens write mode at: [ISAPI_Rewrite].
Open your httpd.ini, find
[ISAPI_Rewrite]

# 3600 = 1 hour 
CacheClockRate 3600 
RepeatLimit 32 
# Protect httpd.ini and httpd.parse.errors files 
# from accessing through HTTP 
RewriteRule ^(.*)/archiver/([a-z0-9-]+.html)$ $1/archiver/index.php?$2 
RewriteRule ^(.*)/forum-([0-9]+)-([0-9]+).html$ $1/forumdisplay.php?fid=$2&page=$3 
RewriteRule ^(.*)/thread-([0-9]+)-([0-9]+)-([0-9]+).html$ $1/viewthread.php?tid=$2&extra=page%3D$4&page=$3 
RewriteRule ^(.*)/profile-(username|uid)-(.+?).html$ $1/viewpro.php?$2=$3

More details please check: / / www jb51. net article / 29390. htm

The difference between
apache does not require a website domain name, while iis requires a website domain name, and IIS encounters a question mark (?) for URL that needs to be rewritten. With the dot (.), need to add () to escape.

The difference between is as follows: :
iis:

RewriteRule ^(.*)/category(d+).html$ $1/index.php?catid=$2

apache:  

RewriteRule ^category(d+).html$ index.php?catid=$1 [QSA,L]


Related articles: