404 Error and Redirect Question

Status
Not open for further replies.

dr00t

Visionary
Jan 8, 2007
92
1
0
Carmel, IN
I have many sites, but one site in particular seems to always have a high 404 error count... I am losing a lot of incoming traffic to a 404 error from posts that I have most likely accidently messed up or something by re-installing my site.... and while that is a whole different issue itself, I need to know HOW to instantly re-direct users from the 404 page to at least an index page for the site...so then they at least view my ads.

I am fully aware that I could build a 404 page and use meta tags to redirect... but I am looking for something a bit more "instant"... I don't even want the user to SEE the 404 page or know it is there... I want them to immediately be taken to my index page. If this means doing something in my .htaccess file, then that's fine.. but I want INSTANT if anything.

Please help! Thanks in advance.
 


Yes, I use .htaccess for tons of other things..

Maybe I am just putting the code in the wrong place? I have it hooked into a wordpress site, so there is already code from that... Here is what I have right now..


Code:
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
ErrorDocument 404 /index.php
 
Try putting just
ErrorDocument 404 /
At the very top of the .htaccess file.
But maybe there needs a special fix, sounds like that on nachoninja.
I know shit about wordpress.
 
OK kids here is the answer for Wordpress:

place this:

Code:
<?php wp_redirect(get_option('home')); ?>
in your 404.php file if you don't have a 404.php file create one and upload it to your theme folder.

I accept paypal payments

PM for address

:batman:
 
OK kids here is the answer for Wordpress:

place this:

Code:
<?php wp_redirect(get_option('home')); ?>
in your 404.php file if you don't have a 404.php file create one and upload it to your theme folder.

I accept paypal payments

PM for address

:batman:

Great! It worked. Just make sure that if there is already any crap in the 404.php file, to make sure this new line of code is the first line... otherwise, it gives errors.

Thank you very much! Now I guess I will redirect alllllllll those stinkin 404 people to my main page. Yippie!
 
Status
Not open for further replies.