2011-04-05 125 views
0

可能重复:
.htaccess redirect的.htaccess重定向

究竟如何,与.htaccess文件我假设,我会重定向人从这个网址:http://blog.twostepmedia.co.uk/win-traffic-with-charlie-sheen-and-the-yahoo-boss-api/喜欢的东西http://www.twostepmedia.co.uk/blog/win-traffic-with-charlie-sheen-and-the-yahoo-boss-api/

谢谢:)

+0

杜佩的http://stackoverflow.com/questions/1190376/a-simple-htaccess-redirect,http://stackoverflow.com/questions/3374696/htaccess-url-重定向,http://stackoverflow.com/questions/3798252/simple-redirect-using-htaccess,还有更多。 – Robert 2011-04-05 08:32:21

回答

2

你最好在我们身边g blog.twostepmedia.co.uk域的.htaccess中的重写规则。

喜欢的东西

RewriteEngine on 
RewriteOptions MaxRedirects=10 # this will just stop and bugs in the code causing a infinite loop 
RewriteRule ^(.+)$ http://www.twostopmedia.co.uk/blog/$1 [R=301,NC] 

无论如下 'blog.twostepmedia.co.uk/' 和重写到新的URL重写规则争夺。 [R = 301,NC]将此设置为永久重定向,这意味着您不会因搜索引擎蜘蛛的重复内容而受到惩罚。

希望帮助:)