You don't need a script; just write a line in your .htaccess file like:
ErrorDocument 404 (http://www.your-domain.com)/whatever-page.html
Both absolute or relative URL should work. Hope this helps.
If you are new to domains and looking to buy, sell and learn about domains then you have come to the right place. DNForum is the largest domain name community on the internet and continues to grow every day. There are over 105,000 domainers on DNForum doing everything from buying domains, selling domains, learning about domains and discussing domains. Take a minute and Register.
Register Today on DNForum IT'S FREE!Hi,
I have many domains pointing to the same place, and today I noticed about 500 404 error page on my stats.
I was wondering if anyone knows of a script or some code that will take 404 error pages (other error pages would be good too) and make them redirect to the main page?
Any help would be appreciated.
thanks
dennis
You don't need a script; just write a line in your .htaccess file like:
ErrorDocument 404 (http://www.your-domain.com)/whatever-page.html
Both absolute or relative URL should work. Hope this helps.
Profoundly influenced by #Bauhaus, @Nameslave unrepentantly embraces #Minimalism in his #multimedia portfolio. His early works include an experimental adaptation of Chekhov’s Cherry Orchard inspired at least partly by Robert Fripp. His totally irrelevant M.Ed. dissertation examines Organizational Culture and Change Management.
I think you have solved my problem., I appreciate it.
thanks
dennis
In this case:
ErrorDocument 404 /whatever-page.html
Some versions of InternetExplorer may NOT show this error page if it is too small. I guess at least 25-30 Kb size is required.
to get more detail, use 'guardian.cgi'. I forgot where I got it, do a search for it relative to 404 errors. Let me know if you can't find it. It reveals much info about your 404 requests, which revealed to me where the traffic was coming from, allowing me to manipulate my domains useage.
An example, I picked up some old domains that had old sites. The old links were still sending traffic, sometimes from deep directory pages. I was able to set up identical directory/file names and show the surfers specific content, efective for affiliate stuff. I also found some sites trying to show the an old domains logo.gif, (they were stealing am image off of another domain for thier domains homepage) so I gave a copy of my logo the identical file name, and now MY logo shows up on thier page, they have no idea where it is coming from! Funny stuff. Also, it showed me which domains were gettign the old link traffic and which ones were not.
You set your htaccess to go to the guardian.cgi on any type of error you like, 404, 401, 501, etc, and it sends you an email of a report of the hit, or files it for you. It shows the IP, linking url, and the file requested, all the http header stuff you can't get with a quick 404 redirection. And after it sends you the email it THEN does the redirect to your desired 404 catch page, homepage, whatever.
If you have a host/server related error, like 500 series errors, you can set it to mail your host admin to alert them about it automatically while you sleep, if your site goes down they need to hop to it.
Also, you can see when people are poking around your site deep in the directories, stabbing at file names, perhaps hacking around; you got their ip, browser type, host name, etc. if you ever needed it.
More involved that you may have asked for, but very good when that stuff matters, especially when you run a bunch of dropped domains!
Regards.
L Golding
L Golding,
thanks I have heard about guardian.cgi I believe it was available on hotscripts.com thanks for the tip
dennis
PM me if you find any nice 404 pages.
__________
www.404s.com
Bookmarks