SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Wizard
    Join Date
    Nov 2003
    Location
    United Kingdom
    Posts
    2,120
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    What should I use for redirect on 404 error pages?

    Hi,

    I am in the middle of coding my pages with php and I want my 404 error pages and my forbidden pages to redirect back to my home page. How can I get them to do this.

    I know that I can use meta refreshing and also 301 permanent redirects. But I was just wondering, which would be the best to use so that I am not banned from Google for using the wrong one.

  2. #2
    winter is around the corner Tomer's Avatar
    Join Date
    Jul 2005
    Location
    Israel
    Posts
    684
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Add this to your .htaccess file:

    ErrorDocument 404 /

    The / after the 404 is the path you want it to redirect to.

    - Tomer

  3. #3
    SitePoint Wizard
    Join Date
    Nov 2003
    Location
    United Kingdom
    Posts
    2,120
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks!

    It works just fine.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •