0

Possible Duplicate:
.htaccess redirect

How exactly, with a .htaccess 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 :)

Community
  • 1
  • 1
benhowdle89
  • 36,900
  • 69
  • 202
  • 331
  • Dupe of http://stackoverflow.com/questions/1190376/a-simple-htaccess-redirect, http://stackoverflow.com/questions/3374696/htaccess-url-redirect, http://stackoverflow.com/questions/3798252/simple-redirect-using-htaccess, and many more. – Robert Apr 05 '11 at 08:32

1 Answers1

2

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 :)

redroot
  • 614
  • 2
  • 7
  • 17