Redirect Pages Not Found To Homepage

Discussion in 'vBulletin' started by aaron_nimocks, Dec 12, 2008.

Thread Status:
Not open for further replies.
  1. #1
    This is really kicking my butt here..

    I have a bunch of traffic that goes to

    http://www.firecontrolman.com/ random files

    Im rebuilding the site completely and those files dont exist anymore. So I want them to be redirected to the homepage instead. I tried .htaccess and doing it in cPanel and nothing works.

    As you can see it the forum loads but it doesnt work properly when people are hitting pages not found. All the URLs have Bibliography in there if they are on a 404 page. Wonder if that could be a template problem also?

    Only thing I know that will fix it is to buy vbseo. But I dont want to do that for something that can be really simple.

    Thanks! [​IMG]
     
    aaron_nimocks, Dec 12, 2008 IP
  2. gemini777

    gemini777 Peon

    Messages:
    21
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Try the following in your htaccess file:

    RewriteEngine On
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-l
    RewriteRule ^(.*)? / [L,R=301]

    This should premanently redirect any non-existant files, directories, and symbolic links to your home page.
     
    gemini777, Dec 13, 2008 IP
  3. aaron_nimocks

    aaron_nimocks Im kind of a big deal Staff

    Messages:
    5,563
    Likes Received:
    627
    Best Answers:
    0
    Trophy Points:
    420
    #3
    I fixed it. Was a template problem.

    Thanks though!
     
    aaron_nimocks, Dec 13, 2008 IP
Thread Status:
Not open for further replies.