我是新来的.htaccess,我找到了一些文章,我试图让它工作,但保持失败。htaccess重写规则问题
我在我的.htaccess文件如下: -
<IfModule mod_ssl.c>
RewriteBase /mydomain.com/
</IfModule>
<IfModule !mod_ssl.c>
RewriteBase/
</IfModule>
RewriteEngine On
RewriteRule ^([^.]*)$ index.cgi/$1 [L]
不过,我希望能够去mydomain.com/more-info,但这种规则使之MYDOMAIN .com/index.cgi/more-info
我该如何使“more-info”免于此规则?
预先感谢您。
所以,乌尔里希建议以下...
#if not /more-info
RewriteCond %{REQUEST_URI} !^/more-info$ [NC]
RewriteRule ^([^.]*)$ index.cgi/$1 [L]
...但我仍然得到 '404未找到'。 more-info目录包含index.htm,如果关闭这个RewriteEngine,它可以正常工作。
这工作完美,谢谢。 – James
不客气,很高兴它解决了问题。 – anubhava