2013-04-24 99 views
0

我有一个用Contao构建的网站。我刚刚打开了U​​RL重写,现在index.php/foo返回404错误。我试图重写/index.php/foo/foo.htaccess:删除/index.php/foo

RewriteCond %{REQUEST_URI} ^/index\.php/ 
RewriteRule ^index.php/(.*) /$1 [R,L] 

,但它并不能帮助。

这里的contao工厂的.htaccess我在它的整体增加的改写部(我编辑了所有的评论的东西,使其更短):

<IfModule mod_rewrite.c> 

    RewriteEngine On 

    RewriteBase/

    RewriteCond %{REQUEST_URI} ^/index\.php/ # My rule here 
    RewriteRule ^index.php/(.*) /$1 [R,L] # My rule here 

    <FilesMatch "\.(png|gif|jpe?g|js|css|ico|php|xml|csv|txt|gz|swf|flv|eot|woff|svg|ttf|htm)$"> 
    RewriteEngine Off 
    </FilesMatch> 

    RewriteRule .*\.html$ index.php [L] 

    RewriteRule ^[a-z]{2}/$ index.php [L] 
    RewriteRule ^([a-z]{2})$ $1/ [R=301,L] 

</IfModule> 

什么我没有得到吗?

回答

0

没关系。我找到了答案。

<FilesMatch "\.(png|gif|jpe?g|js|css|ico|THIS HERE CAUSED IT: --> ***php***|xml|csv|txt|gz|swf|flv|eot|woff|svg|ttf|htm)$"> 
RewriteEngine Off 
</FilesMatch>