Htaccess conversion httpd.ini method

  
                  

From apache to iis, I encountered the problem of converting .htacess to httpd.ini. After groping, I got the following

Conclusion You can try it, not necessarily right. First look at the source code in .htacess
RewriteEngine On RewriteCond %{HTTP_HOST} !^www.45it.net$ RewriteRule ^(.*)$ http://www.45it.net/$1 [R=301,L , NC] RewriteBase /RewriteRule ^([^-/\\.\\_\\-]+)\\.html$ $1.php? RewriteRule ^([^-/\\.\\_\\-]+)-op([^ -/]+)-sor([^-/]+)-det([^-/]+)\\.html$$1.php?op=$2&sor=$3&det=$4 RewriteRule ^([ ,null,null,3],^-/\\.\\_\\-]+)-op([^-/]+)-sor([^-/]+)\\.html$ $1.php?op=$2&sor=$3 RewriteRule ^ ([^-/\\.\\_\\-]+)-sor([^-/]+)\\.html$ $1.php?sor=$2 RewriteRule ^([^-/\\.\\_\\-]+ )-op([^-/]+)\\.html$ $1.php?op=$2 RewriteRule ^([^-/\\.\\_\\-]+)-page([^-/]+)\\. Html$ $1.php?page=$2 RewriteRule ^([^-/\\.\\_\\-]+)-op([^-/]+)-sor([^-/]+)-page([^ -/]+)\\.html$$1.php?op=$2&sor=$3&page=$4

Next look at the http.ini writing after conversion
[ISAPI_Rewrite] RewriteRule /([^-/\\.\\_\\-]+)\\.html$ /$1.php? RewriteRule /([^-/\\.\\_\\-]+)-op([^-/]+)- Sor([^-/]+)-det([^-/]+)\\.html$/$1.php?op=$2&sor=$3&det=$4 RewriteRule /([^-/\\. \\_\\ -]+)-op([^-/]+)-sor([^-/]+)\\.html$ /$1.php?op=$2&sor=$3 RewriteRule /([^-/\\. \\_\\-]+)-sor([^-/]+)\\.html$ /$1.php?sor=$2 RewriteRule /([^-/\\.\\_\\-]+)-op([^ -/]+)\\.html$ /$1.php?op=$2 RewriteRule /([^-/\\.\\_\\-]+)-page([^-/]+)\\.html$ /$1. Php?page=$2 RewriteRule /([^-/\\.\\_\\-]+)-op([^-/]+)-sor([^-/]+)-page([^-/]+ )\\.html$/$1.php?op=$2&sor=$3&page=$4

In the .htacess conversion httpd.ini conversion result, we obviously see the changes we made. The colored part of the place is modified. In the .htacess conversion httpd.ini conversion, it is necessary to let apache and iis understand what we want it to do. The above code is not difficult to see: The first is to change the definition of the rule, from rewrite_module Become isapi_rewrite Second, the path is changed, the path of .htacess is defined in the header, and httpd.ini is defined in each rule. When .htacess converts httpd.ini, the ^ symbol in .htacess is changed to /, Add the path /in front of the stand-alone page, to understand this /should be the root directory of the relative directory.
zh-CN"],null,[0.9869619],zh-CN"]]]

Copyright © Windows knowledge All Rights Reserved