htaccess 301重定向与不同的文件夹结构

时间:2015-06-29 11:34:41

标签: regex apache .htaccess redirect

感谢所有提前,我认为我已经掌握了这一点,但显然不是!

我正在使用htaccess重定向

将网站永久移至新域名

旧地址www.example.com/home/index.php

新地址www.example2.ie/index.php

我尝试过使用RedirectMatch 301 ^ / http://example2.ie/,但最终得到了像http://example2.iehome/这样的网址.......

我如何解决这个问题,我是否正确地解决了上述问题?

干杯

1 个答案:

答案 0 :(得分:0)

您应该使用:

RedirectMatch 301 ^/home/(.+)$ http://example2.ie/$1
相关问题