Results 1 to 14 of 14

301 redirect 404 pages?

This is a discussion on 301 redirect 404 pages? within the Off-Topic & Chit Chat forums, part of the Focus on Members category; Hi guys, I need some help with regards to placing a 301 redirect (to the homepage) on all 404 page ...

  1. #1
    Member Steve's Avatar
    Real Name
    Steve P.
    Join Date
    Aug 2005
    Posts
    35
    Liked
    0 times

    301 redirect 404 pages?

    Hi guys,

    I need some help with regards to placing a 301 redirect (to the homepage) on all 404 page not found error messages. I'm not all that familiar with all that .htaccess razamatazz and have tried using some code provided on certain websites but none have yielded any results thus far.

    Basically I want it so that if someone should accidentally visit the wrong URL, say; http://www.site.com/wrongurl/ they be redirected to the homepage at: http://www.site.com/

    If anyone would be so kind as to enlighten me with the necessary code then I would be eternally grateful. Thanks in advance.
    Professional an affordable WordPress themes developed by PureWordPress.com
    Devil May Cry | Devil May Cry Forum | Devil May Cry Gallery for Devil May Cry, Devil May Cry 3 and Devil May Cry 4 news
    Fable 2 | Fable 2 Forum for Fable, Fable: The Lost Chapters and Fable 2 news
    Assassin's Creed | Assassin's Creed Forum for Assassin's Creed news
    Resident Evil | Resident Evil Forum for Resident Evil, Resident Evil 4 and Resident Evil 5 news (Under construction)

  2. #2
    Senior Member
    Real Name
    Keith Cohen
    Join Date
    Jul 2005
    Location
    Raleigh, NC USA
    Posts
    6,147
    Liked
    13 times
    vBSEO has this option built in. Look for the ""File Not Found" requests handling?" option.

  3. #3
    Member Steve's Avatar
    Real Name
    Steve P.
    Join Date
    Aug 2005
    Posts
    35
    Liked
    0 times
    Hi Keith,

    I actually don't need this for my forum (although I must admit I hadn't seen that option on vBSEO before! ). I'll be implementing this to my .htaccess file which is used for my CMS located outside of my forum's directory.
    Professional an affordable WordPress themes developed by PureWordPress.com
    Devil May Cry | Devil May Cry Forum | Devil May Cry Gallery for Devil May Cry, Devil May Cry 3 and Devil May Cry 4 news
    Fable 2 | Fable 2 Forum for Fable, Fable: The Lost Chapters and Fable 2 news
    Assassin's Creed | Assassin's Creed Forum for Assassin's Creed news
    Resident Evil | Resident Evil Forum for Resident Evil, Resident Evil 4 and Resident Evil 5 news (Under construction)

  4. #4
    vBSEO Staff Juan Muriente's Avatar
    Real Name
    Juan Carlos Muriente
    Join Date
    Jun 2005
    Location
    Puerto Rico
    Posts
    14,266
    Liked
    586 times
    The following should work :
    Code:
    RewriteEngine on
    RewriteCond %{REQUST_FILENAME} !-f
    RewriteCond %{REQUST_FILENAME} !-d
    RewriteRule .+ http://www.site.com [L,R=301]

  5. #5
    Member Steve's Avatar
    Real Name
    Steve P.
    Join Date
    Aug 2005
    Posts
    35
    Liked
    0 times
    Hi Juan,

    That didn't appear to work, when I typed an incorrect URL (or any page for that matter) into my browser it just came up with:

    The page isn't redirecting properly

    Firefox has detected that the server is redirecting the request for this address in a way that will never complete.
    * This problem can sometimes be caused by disabling or refusing to accept
    cookies.
    I don't know if it would help, but this is my current .htaccess file and I don't know if code that is already in there might be conflicting with the code you gave me.

    Code:
    # -FrontPage-
    
    IndexIgnore .htaccess */.??* *~ *# */HEADER* */README* */_vti*
    
    <Limit GET POST>
    order deny,allow
    deny from all
    allow from all
    </Limit>
    <Limit PUT DELETE>
    order deny,allow
    deny from all
    </Limit>
    AuthName www.projectego.net
    AuthUserFile /home/ultimas/public_html/_vti_pvt/service.pwd
    AuthGroupFile /home/ultimas/public_html/_vti_pvt/service.grp
    
    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>
    
    # END WordPress
    Please help!
    Professional an affordable WordPress themes developed by PureWordPress.com
    Devil May Cry | Devil May Cry Forum | Devil May Cry Gallery for Devil May Cry, Devil May Cry 3 and Devil May Cry 4 news
    Fable 2 | Fable 2 Forum for Fable, Fable: The Lost Chapters and Fable 2 news
    Assassin's Creed | Assassin's Creed Forum for Assassin's Creed news
    Resident Evil | Resident Evil Forum for Resident Evil, Resident Evil 4 and Resident Evil 5 news (Under construction)

  6. #6
    vBSEO Staff Oleg Ignatiuk's Avatar
    Real Name
    Oleg Ignatiuk
    Join Date
    Jun 2005
    Location
    Belarus
    Posts
    25,744
    Liked
    169 times
    Hello Steve,

    you already have "file not found" rewrite rules defined for wordpress, so you cannot redefine them for redirection.

  7. #7
    Zi5
    Zi5 is offline
    Member
    Real Name
    Kool
    Join Date
    Feb 2007
    Posts
    73
    Liked
    0 times
    Hello Oleg,
    I just want to know how i can redirect my Error pages outside forum using 301 redirect please , that steps your write upstaris is redirecting all pages even it not wrong .
    Thanks ,
    Zi5

  8. #8
    vBSEO Staff Oleg Ignatiuk's Avatar
    Real Name
    Oleg Ignatiuk
    Join Date
    Jun 2005
    Location
    Belarus
    Posts
    25,744
    Liked
    169 times
    Do you have an existing .htaccess file outside of forum folder?

  9. #9
    Zi5
    Zi5 is offline
    Member
    Real Name
    Kool
    Join Date
    Feb 2007
    Posts
    73
    Liked
    0 times
    Yes

  10. #10
    Zi5
    Zi5 is offline
    Member
    Real Name
    Kool
    Join Date
    Feb 2007
    Posts
    73
    Liked
    0 times
    Hello Oleg ,
    I am still watting for your answer .
    Thanks,
    Zi5

  11. #11
    Senior Member briansol's Avatar
    Real Name
    Brian
    Join Date
    Apr 2006
    Location
    Central CT, USA
    Posts
    6,981
    Liked
    8 times
    If it's wordpress powered, you need to use wordpress's api for making your custom error page, not vbseo.
    Creating an Error 404 Page WordPress Codex

  12. #12
    Zi5
    Zi5 is offline
    Member
    Real Name
    Kool
    Join Date
    Feb 2007
    Posts
    73
    Liked
    0 times
    No, I didn't use wordpress ,I use in /vb directory vBulletin with vbSEO , and in root folder i use vBadvanced , but when someone typing a wrong URL outside /vb it's not redirect him the forum or the website .
    Thanks ,
    Zi5

  13. #13
    Senior Member briansol's Avatar
    Real Name
    Brian
    Join Date
    Apr 2006
    Location
    Central CT, USA
    Posts
    6,981
    Liked
    8 times
    Oh, i didn't realize this was an old thread.. i scrolled up and saw steve's htaccess.

    in root htaccess, simply put

    ErrorDocument 404 /vb/404.php

    directly after rewrite engine on.


    if you don't have a root htacces file, make one with just those 2 lines.

  14. #14
    Zi5
    Zi5 is offline
    Member
    Real Name
    Kool
    Join Date
    Feb 2007
    Posts
    73
    Liked
    0 times
    Thanks too much ...
    This helps right .
    Zi5

Similar Threads

  1. My Guide on the features of VBSEO
    By BamaStangGuy in forum Member Articles
    Replies: 18
    Last Post: 11-28-2006, 03:29 PM
  2. i think something is wrong....
    By briansol in forum General Discussion
    Replies: 3
    Last Post: 08-20-2006, 06:10 PM
  3. Replies: 8
    Last Post: 08-15-2006, 04:10 AM
  4. Compression Error
    By Lazer in forum Troubleshooting
    Replies: 19
    Last Post: 03-03-2006, 01:23 PM

Posting Permissions

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