最新回答 / 矢志不渝LIU
这就要看你的访问路径是不是在www根目录下了,就比如我用的是phpstudy,是在www下建立的一个test文件夹,我都是重新复制一个,不然直接在www的Directory里配置都没生效,使用.htaccess还报错<...图片...>
2020-04-04
RewriteEngine on
RewriteCond %{HTTP_HOST} "127.0.0.(.*)"
RewriteCond %1 "1"
RewriteRule ^(.*)\.htm http://localhost/$1.html [R]
RewriteCond %{HTTP_HOST} "127.0.0.(.*)"
RewriteCond %1 "1"
RewriteRule ^(.*)\.htm http://localhost/$1.html [R]
2019-04-28
RewriteEngine on
RewriteCond $1 "test"
RewriteRule ^(.*)\.htm $1.html [R]
RewriteCond $1 "test"
RewriteRule ^(.*)\.htm $1.html [R]
2019-04-28
最新回答 / _Jack_Han_
第二行和第三行匹配的结尾字符串要么都是\.htm$或者都是\.html$因为在第一条rule匹配成功后,后缀名变成.html请求再次进入.htaccess文件,此时第一条rule无法匹配后缀名.html,所以会走第二条rule
2018-12-16