2016-05-31 17 views
0

我有一個重定向問題。Htaccess joomla項目中的重定向問題

我試圖從http://www.project.com/index.php重定向到http://www.project.com

我嘗試以下,但它進了一步回任何index.php這樣。

RewriteCond %{THE_REQUEST} ^.*/index\.php 
RewriteRule ^(.*)index.php$ /$1 [R=301,L] 
+0

我剛剛意識到這是您已經問過的問題的重複,並且我已經回答了...? – Lag

+0

[joomla中的[Htaccess重定向問題]可能的重複](http://stackoverflow.com/問題/ 37463416/HT訪問重定向的問題 - 在-的Joomla) – Lag

回答

0

要刪除的index.php使用:

RewriteBase/
RewriteCond %{THE_REQUEST} ^GET.*index\.php [NC] 
RewriteRule (.*?)index\.php/*(.*) /$1$2 [R=301,NE,L] 

但是,您也可以使用以下作爲替代(但它會要求你啓用了mod_rewrite爲它工作:

RewriteEngine On 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteRule ^(.*)$ /index.php?/$1 [L]