1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Im struggling with .htaccess redirects

Discussion in 'Web Design' started by fairlyliquid, Aug 14, 2011.

  1. fairlyliquid

    fairlyliquid Newbie

    Joined:
    Feb 22, 2011
    Messages:
    34
    Likes Received:
    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
     
  2. ``Yousef

    ``Yousef Power Member

    Joined:
    Oct 16, 2009
    Messages:
    534
    Likes Received:
    286
    Location:
    Cooking up the medicine.
    Home Page:
    Try this instead;

    Code:
    redirect 301 /folder-path/faq/ http://newdomain.com/faq/
    Also, what do you mean by;

     
  3. fairlyliquid

    fairlyliquid Newbie

    Joined:
    Feb 22, 2011
    Messages:
    34
    Likes Received:
    0
    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