2015-05-14 52 views
-1

我在zend框架1中有一個項目,其中,谷歌索引鏈接與http://www.example.com/index.php/url而不是http://www.example.com/url,從而創建重複和不需要的鏈接。在zend框架中從apache 2.4.6上的url中刪除index.php

我在htaccess的這條規則

RewriteRule ^index\.php(.*)$ /$1 [R=301,QSA,L] 

的是,工作得很好,直到我們升級的Apache 2.4.6自那時以來它只是重定向像www.example.com/index.phpurl而不是www.example鏈接.com/index.php/url,index.php/url似乎不包含在這個表達式中。

有沒有人知道這個解決方案?

+0

當我發現存在的Apache 2.4.6 https://bz.apache.org/bugzilla/show_bug.cgi?id=53929的錯誤。我現在不能改變apache版本,所以我需要一個解決方案來部署在.htaccess中來解決這個問題。 – Cosmin

回答

-1

試試這個

RewriteEngine On 
RewriteBase /myproject/ 

RewriteCond %{REQUEST_FILENAME} -s [OR] 
RewriteCond %{REQUEST_FILENAME} -l [OR] 
RewriteCond %{REQUEST_FILENAME} -d 
RewriteRule^- [L] 

RewriteRule ^(.+)$ index.php/$1 [L] 
+0

OP想要重定向舊的鏈接。 –

+0

這並不能幫助我以任何方式重定向鏈接。正如我所說的,在將Apache升級到2.4.6之前,該規則起作用,但之後沒有。 – Cosmin