Best way to redirect old urls to new pages

Discussion in 'HTML & Website Design' started by noddy10, Jan 9, 2009.

  1. #1
    Hi - I'm about to redesign my site and I now realise that some of my pages have poor names (e.g "blah blah.html" instead of "blah-blah.html") so I have white spaces in some of the url names. The urls in the new sites will also make better use of my keywords.

    I have backlinks from article directories etc to the urlnames that I don't like now and I obviously don't want broken links all over my site. What's the best way to redirect oldname.html to newname.html ? Thanks...
     
    noddy10, Jan 9, 2009 IP
  2. StevePro

    StevePro Peon

    Messages:
    106
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #2
    As long as you are using a a linux server with apache (with mod-rewrite enabled) you could look at using .htaccess redirects - http://www.webweaver.nu/html-tips/web-redirection.shtml - however if the file names don't follow any standard (e.g. one file is called 'blah blah.html and another is blah_blah.html or blahblah 1.html) this probably won't work.

    You could look at emptying your current poor files (e.g. blah blah.html) and use meta redirects for each page

    Example of new blah blah.html page
    
    <html>
    <head>
    <meta http-equiv="refresh" content="0; url=http://example.com/blah-blah.html"> 
    </head>
    <body>
    </body>
    </html>
    HTML:
    This will re-direct the visitors and search engines - but I'm not sure what it would do to the page's pagerank???
     
    StevePro, Jan 9, 2009 IP
    noddy10 likes this.
  3. noddy10

    noddy10 Peon

    Messages:
    49
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #3
    thanks mate - another approach that i found using google is this:

    Redirect 301 /oldpage.html http://www.example.com/newpage.html

    can anyone comment on whether it's bad for me from a PR/SEO point of view to have some effectively "dead" links permanently re-directing to the real pages. I'm probably looking at about 6 links that would have to be like that. Thanks.
     
    noddy10, Jan 10, 2009 IP
  4. euphoriajoca

    euphoriajoca Peon

    Messages:
    112
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Maybe you should do some rewrite rules in .htaccess
    That's what I would do.
     
    euphoriajoca, Jan 11, 2009 IP
    noddy10 likes this.
  5. simstar

    simstar Peon

    Messages:
    467
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #5
    <?
    Header( "HTTP/1.1 301 Moved Permanently" );
    Header( "Location: http://www.new-url.com" );
    ?> 
    PHP:
    Thats the best way a 301 redirect. Works better with search engines!
     
    simstar, Jan 11, 2009 IP
    noddy10 likes this.
  6. StevePro

    StevePro Peon

    Messages:
    106
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #6
    Have just started using the above, is simple and clean. Thanks for that.
     
    StevePro, Jan 27, 2009 IP