2013-04-24 103 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>