httpd.ini 举例一个
-----------------------------------------------------------------------------------------------------------
[ISAPI_Rewrite]
# 3600 = 1 hour
CacheClockRate 3600
RepeatLimit 32
# Protect httpd.ini and httpd.parse.errors files
# from accessing through HTTP
# duoduo Rewrite规则
RewriteRule ^/index\.html$ /index\.php
RewriteRule ^/sitemap\.html$ /sitemap\.php
RewriteRule ^/malllist\.html$ /malllist\.php
-----------------------------------------------------------------------------------------------------------
转换成 .htaccess 注意看不同点 下次按照这样转换即可。
-----------------------------------------------------------------------------------------------------------
RewriteEngine On
RewriteBase /
# duoduo Rewrite规则
RewriteRule index\.html$ /index\.php
RewriteRule sitemap\.html$ /sitemap\.php
RewriteRule malllist\.html$ /malllist\.php
-----------------------------------------------------------------------------------------------------------
httpd.ini 转换 .htaccess 一般规则说明:
1.
[ISAPI_Rewrite]
# 3600 = 1 hour
CacheClockRate 3600
RepeatLimit 32
# Protect httpd.ini and httpd.parse.errors files
# from accessing through HTTP
换成:
RewriteEngine On
RewriteBase /
2.
RewriteRule ^/index\.html$ /index\.php
去掉 ^/
RewriteRule index\.html$ /index\.php
-----------------------------------------------------------------------------------------------------------
.htaccess 转换成 nginx 注意看不同点 下次按照这样转换即可。
-----------------------------------.htaccess-----------------------------------------------------
RewriteEngine On
RewriteBase /
# duoduo Rewrite规则
RewriteRule index\.html$ /index\.php
RewriteRule sitemap\.html$ /sitemap\.php
RewriteRule malllist\.html$ /malllist\.php
------------------------------------nginx----------------------------------------------------------
location / {
rewrite /index\.html$ /index.php last;
rewrite /sitemap\.html$ /sitemap.php last;
rewrite /malllist\.html$ /malllist.php last;-
----------------------------------------------------------------------------------------------------------
.htaccess 转换成 nginx 说明
-----------------------------------------------------------------------------------------------------------
1.
RewriteEngine On
RewriteBase /
# duoduo Rewrite规则
转换为:
location / {
2.
RewriteRule index\.html$ /index\.php
转换为:
rewrite /index\.html$ /index.php last;
-----------------------------------------------------------------------------------------------------------
送上在线转换的地方:
.htaccess Editor :http://www.htaccesseditor.com/sc.shtml
http://www.anilcetin.com/convert-apache-htaccess-to-nginx/
版权与免责声明:
凡注明稿件来源的内容均为转载稿或由网友用户注册发布,本网转载出于传递更多信息的目的;如转载稿涉及版权问题,请作者联系我们,同时对于用户评论等信息,本网并不意味着赞同其观点或证实其内容的真实性;