Fixing 404 pages with a 301 redirect?

Discussion in 'Search Engine Optimization' started by ianv, Jan 24, 2011.

  1. #1
    Hi

    I have just redesigned my site and in Google Webmaster tools there are 80 pages that show up as crawl errors because of the pages no longer exist as it is a different URL structure.

    Will this affect my SEO ranking such, and how do I go about using a 301 redirect to send the visitor to the new version of the page?

    TIA
     
    ianv, Jan 24, 2011 IP
  2. altertix

    altertix Greenhorn

    Messages:
    39
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    16
    #2
    Yes it could affect your rankings so you should fix all your 404 by redirecting the visitor to the new corresponding page.

    Do you have acces to the .htaccess file ? If the answer is yes, you can make all the redirects in this file like that :

    RedirectPermanent old-page-name.html http://www.you-website-url.tld/new-page-name.html

    It must be on the same line, without any return.
     
    altertix, Jan 24, 2011 IP
  3. webdev007

    webdev007 Active Member

    Messages:
    1,037
    Likes Received:
    13
    Best Answers:
    3
    Trophy Points:
    88
    #3
    Either do 301 redirect those pages or exclude those from Google index using the robots.txt file. The urls you disallow in robots.txt will be fainted out from Google index after some time.
     
    webdev007, Jan 24, 2011 IP
  4. rain21

    rain21 Active Member

    Messages:
    1,365
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    73
  5. ianv

    ianv Peon

    Messages:
    7
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Thanks can an .htaccess file be created in notepad and then saved as .htaccess? Then where does it sit on the webserver on the web root? Is there a way of checking that it has been created and uploaded correctly?

    For example I have started an .htaccess file shown below to fix canonical issues, does this look ok? And how would I add the redirects would it be

    RedirectPermanent oldpage.php mydomain.co. uk/newpage-name.php

    Options +FollowSymlinks
    RewriteEngine on
    RewriteCond %{HTTP_HOST} ^mydomain. co.uk
    RewriteRule ^(.*)$ www. mydomain. co.uk /$1 [L,R=301]
    RewriteRule ^index.html$ / [R=301,L]
     
    ianv, Jan 24, 2011 IP
  6. altertix

    altertix Greenhorn

    Messages:
    39
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    16
    #6
    Yes your .htaccess seems to be ok. You have to upload it at your website root, yes. But you have to check if your host have enabled the apache mod_rewrite

    And yes for the redirect, the syntax is ok, just put it after your last rewrite rule

     
    altertix, Jan 24, 2011 IP
  7. ianv

    ianv Peon

    Messages:
    7
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #7
    Also to fix the canonical url issue - how do you check that you first of all have canonical url issues?

    Is it if google views the following

    http:// domain. co.uk
    http:// www. domain. co.uk
    http:// www .domain.co.uk/ index.php
    http:// domain. co.uk /index.php

    as four seperate pages, which affects your search ranking? Also how then would you build 4 URL's into the rewritecond above as the example above only has one URL?
     
    ianv, Jan 25, 2011 IP
  8. singlemalter

    singlemalter Greenhorn

    Messages:
    30
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    16
    #8
    301 redirect in your htaccess is key, like this:
    301 redirect old_page.html full_url_to_new_page.html
     
    singlemalter, Jan 25, 2011 IP
  9. ianv

    ianv Peon

    Messages:
    7
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #9
    Thanks but how would you change the code below
    Options +FollowSymlinks
    RewriteEngine on
    RewriteCond %{HTTP_HOST} ^mydomain. co.uk
    RewriteRule ^(.*)$ www. mydomain. co.uk /$1 [L,R=301]
    RewriteRule ^index.html$ / [R=301,L]

    so that the following URLs point/rewrite to http:// www. domain. co.uk ?
    http:// domain. co.uk and
    http:// domain. co.uk /index.php
    and
    http:// www .domain.co.uk/ index.php
     
    ianv, Jan 26, 2011 IP
  10. Javaid.

    Javaid. Peon

    Messages:
    69
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #10
    It's a fact, Page Not Found, known as a 404 error, can harm your website Ranking with Search Engines as well as being a Turn-Off for Visitors.
     
    Javaid., Jan 27, 2011 IP
  11. altertix

    altertix Greenhorn

    Messages:
    39
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    16
    #11
    Hi ianv, here is the right code for redirecting the duplicate cases :
    #redirects all url's to the with www ones
    RewriteCond %{HTTP_HOST} ^mydomain.co.uk$ [NC]
    RewriteRule ^(.*)$ http://www.mydomain.co.uk/$1 [L,R=301]
    #redirects all index types to the domain root
    RewriteCond %{THE_REQUEST} ^(GET|POST|HEAD)\ (/.*)?/index.(htm|html|php|asp|shtml)
    RewriteRule ^(.*)index.(htm|html|php|asp|shtml)$ /$1 [R=301,L]
    #redirects the trailing slash
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.+)/$ /$1 [R=301,L]

    Hope it helps!

     
    altertix, Jan 30, 2011 IP