开发者

.htaccess redirect [duplicate]

开发者 https://www.devze.com 2023-02-21 22:20 出处:网络
This question already has answers here: Closed 11 years ago. Possible Duplicate: .htaccess redirect How exactly, with a .开发者_如何学Chtaccess file i\'m presuming, would i redirect peop
This question already has answers here: Closed 11 years ago.

Possible Duplicate:

.htaccess redirect

How exactly, with a .开发者_如何学Chtaccess file i'm presuming, would i redirect people from this URL: http://blog.twostepmedia.co.uk/win-traffic-with-charlie-sheen-and-the-yahoo-boss-api/ to something like http://www.twostepmedia.co.uk/blog/win-traffic-with-charlie-sheen-and-the-yahoo-boss-api/

Thanks :)


You're better off using a rewrite rule in your .htaccess of the blog.twostepmedia.co.uk domain.

Something like

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]

The rewrite rule grabs whatever follows 'blog.twostepmedia.co.uk/' and rewrites to the new url. The [R=301,NC] sets this to be a permanent redirect, which means you won't get penalised from duplicate content by search engine spiders.

Hope that helps :)

0

精彩评论

暂无评论...
验证码 换一张
取 消