在ISAPI中重定向URL的正确语法是什么?将文件夹中的URL重写到主页?例如...... /category/sub-category/file.html
我尝试了很多东西,比如......
RewriteRule ^category/sub-category/file.html / [NC,R=301,L]
RewriteRule ^category/sub-category/file.html http://www.mysite.com/ [NC,R=301,L]
RewriteRule ^category/sub-category/file.html http\://www.mysite\.com/ [NC,R=301,L]
RewriteRule ^category/sub-category/file\.html / [NC,R=301,L]
RewriteRule ^category/sub-category\/file\.html / [NC,R=301,L]
etc.
......但我似乎无法工作!
答案 0 :(得分:1)
确保您拥有以下内容:
RewriteEngine on
RewriteBase /
RewriteRule ^category/sub-category/file\.html$ http://www.domain.com/ [NC,R=301,L]
如果上述方法不起作用,请尝试按照Helicon的常见问题解答(http://www.helicontech.com/forum/10648-FAQ.html)进行操作,并确保ISAPI_Rewrite正常工作。这是ISAPI_Rewrite3,对吧?