Redirection Of Internal Links

Discussion in 'Site & Server Administration' started by Clientchuk, Nov 20, 2010.

  1. #1
    I had an old website, then I deleted it and set a 301 redirect of its domain to my new website. But there is a problem: when people click the old links to the internal pages of the old website, it redirects them not to the main page of the new website but to the pages that don't exist and they get a 404 page. Example of what happens:
    <link>oldsite/page1</link> ---> newsite/page1 (404)
    How can I change it so that all old links led to the main page of the new website? Should I set a redirect manually for all the old pages that I had before?
     
    Clientchuk, Nov 20, 2010 IP
  2. Koala

    Koala Well-Known Member

    Messages:
    1,831
    Likes Received:
    14
    Best Answers:
    0
    Trophy Points:
    185
    Digital Goods:
    5
    Articles:
    4
    #2
    add this code to your .htaccess.

    replace yourwebsiteurl.com with your site which you want to be redirected.
    hope this helps
    -Viraj-
     
    Koala, Nov 23, 2010 IP
  3. Clientchuk

    Clientchuk Active Member

    Messages:
    152
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    53
    #3
    Are you sure this is the correct code? Can I place it anywhere in the file? I ask because nothing changes ((
     
    Clientchuk, Nov 23, 2010 IP
  4. Koala

    Koala Well-Known Member

    Messages:
    1,831
    Likes Received:
    14
    Best Answers:
    0
    Trophy Points:
    185
    Digital Goods:
    5
    Articles:
    4
    #4
    yes, anywhere in the file. try it and let us know what happened.
     
    Koala, Nov 23, 2010 IP
  5. Clientchuk

    Clientchuk Active Member

    Messages:
    152
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    53
    #5
    I added that string into htaccess file 10 minutes ago but still have 404 page.
     
    Clientchuk, Nov 24, 2010 IP