Dismiss Notice
Welcome to Our Community
Wanting to join the rest of our members? Feel free to sign up today.

Redirect 301

Discussion in 'Programming' started by Finlay, Feb 1, 2009.

  1. Finlay

    Finlay New Member Webmaster

    Hi guys
    I must insert in a html site a htaccess file that create a redirect 301 to
    the site home page for every page that gives error 404 (Page not found), but
    without affecting the single redirect 301 already present in the file
    htaccess regarding other subpage moved and renamed in the past.

    The purpose of all of this is not losing the google page rank that can be
    passed trough every bad written back link .

    What do I write in the htaccess file to do this? Do I have to write it
    before or after the existing rules?

    Usually I have only one or two error 404 for months to redirect: I wouldn't have to have a penalty for duplicate pages, isn't it?

    Thank you
  2. BlueBoden

    BlueBoden New Member Webmaster

    The format for redirecting pages is (Redirect code old-page.html new-page.html) Example follows:

    Redirect 301 /old-page.html http://www.brugbart.com/newpage.html
    The above redirects the "old-page.html" from a root relative point, you can also use absolute paths.

    I would say that you should focus your efforts elseware, giving a 301 redirect instead of 404 on your broken links is a bad idea, the errors are in place for a reason, and they could potientially end up confusing your visitors.

    You can however create some custom error pages, which can be used to help your visitors. Example:
    ErrorDocument 404 /404.html
    If you need to know the pages which generates 404, then check your server-log files, or the Google Webmaster Tools.
  3. Finlay

    Finlay New Member Webmaster

    all clear now

Featured Resources (View All)

Share This Page