2015-07-13 126 views
1

我有這樣的網址: my-site.com/index.php/2014。URL重定向URL後文件擴展名[htaccess]

我想刪除此網址並將其全部重定向到我的根網域。 谷歌索引了很多這個網址,我的排名非常低。他們以內容來評判我。

每個URL都帶有/後面的php文件擴展名我想重定向到我的根域。

例如:的index.php/2004 - >的index.phpteam.php/2004/2004年 - > team.php 等..

感謝您的幫助。

回答

2
RedirectMatch 301 ^/index\.php/(.+)$ http://example.com/index.php 

RedirectMatch 301 ^/team\.php/(.+)$ http://example.com/team.php 

編輯:

您還可以重定向的只是一個單一的線重定向網址:

RedirectMatch 301 ^/([^.]+)\.php/(.+)$ http://example.com/$1.php 
+2

謝謝,其workng,但有一個機會,不寫的頁面名稱,自動的東西? –