Im struggling with .htaccess redirects

fairlyliquid

Newbie
Joined
Feb 22, 2011
Messages
34
Reaction score
0
Hi, i got a feeling this is a noob question but im going round in circles with google and getting confused...

ive had a site on a free host for about 6 months so its already indexed by google.

ive now bought a new domain and parked it on top of it

im trying to set up 301 redirects for the indexed pages on the free url to redirect to the new domain name to avoid duplicate content

so i tried putting this at the end of the .htaccess files

Code:
redirect 301 freehostname/faq/ newdomain/faq/

but that doesnt work :(

Its a wordpress site btw

hope thats clear site wont let me post anything that looks even vaguely like a url, i feel like im missing something obvious
 
Try this instead;

Code:
redirect 301 /folder-path/faq/ http://newdomain.com/faq/

Also, what do you mean by;

hope thats clear site wont let me post anything that looks even vaguely like a url, i feel like im missing something obvious
 
Hi thanks for the reply. I think ive managed to get it working using ...

Code:
RewriteEngine on
RewriteCond %{HTTP_HOST} ^oldsite$ [OR]
RewriteCond %{HTTP_HOST} ^oldsitewithwww$
RewriteRule ^faq/$ newdomain/faq/ [R=301,L]

seems to work anyway

and what i meant was the spam filter on this forum is making this post very hard as i cant post anything even similar to a url, cant even quote your post. I think i need to make more posts lol
 
Back
Top