2015-07-13 60 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,但有一个机会,不写的页面名称,自动的东西? –