Results 1 to 11 of 11
Thread: 404 to index
-
06-04-2005, 04:55 PM #1Web Hosting Master
- Join Date
- Jun 2004
- Posts
- 2,853
404 to index
What's the script (html) for redirecting 404'ers to a page?
It's like meta refresh "index" or something.
Thanks.
-
06-04-2005, 05:05 PM #2Web Hosting Master
- Join Date
- Dec 2003
- Location
- Vancouver BC, eh?
- Posts
- 571
Opening up your .htaccess file (assuming you are on apache server) you can create a custom 404 doc, with a message and maybe a javascript redirect or just a message:
ErrorDocument 404 /path_to_error_page/404.html
I do this but a slight variation by having one error page and using get vars to choose which error message to display:
ErrorDocument 404 /path_to_error_page/error.php?e=404
for example. This just keeps the organization of it simpler.
-
06-04-2005, 11:43 PM #3Web Hosting Master
- Join Date
- Oct 2004
- Posts
- 1,171
in your .htaccess:
ErrorDocument 404 /index.ext
replace ext with whatever extention your index page iswww.Yekaroo.com - Your Chinese Radio Online!
-
06-05-2005, 08:44 AM #4New Member
- Join Date
- Jun 2005
- Location
- The Netherlands
- Posts
- 1
Originally posted by Diaga
in your .htaccess:
ErrorDocument 404 /index.ext
replace ext with whatever extention your index page is
This what my htaccess looks like:
[R=301,L]
ErrorDocument 404 /crap.html
-
06-05-2005, 01:17 PM #5Web Hosting Master
- Join Date
- Jun 2004
- Posts
- 2,853
This is not what i'm looking for.
-
06-05-2005, 01:21 PM #6Aspiring Evangelist
- Join Date
- Jun 2004
- Location
- Tampa, Fl
- Posts
- 442
Well then, what are you looking for?
█ DBLHost.com
█ US Based Shared Web Hosting • cPanel+Softaculous • Email Hosting • Domain Names
█ https://www.dblhost.com
-
06-05-2005, 07:36 PM #7Web Hosting Master
- Join Date
- Jun 2004
- Posts
- 2,853
It's like meta refresh "index" or something. - It's an html file.
-
06-05-2005, 07:42 PM #8Web Hosting Master
- Join Date
- Oct 2004
- Posts
- 1,171
In the head:
<meta http-equiv="refresh" content="2;url=http://webhostingtalk.com/">
the 2 - would be the # of seconds to wait after page load (adjust accordingly)
the url, self explanatorywww.Yekaroo.com - Your Chinese Radio Online!
-
06-05-2005, 07:50 PM #9Web Hosting Master
- Join Date
- Dec 2003
- Location
- Vancouver BC, eh?
- Posts
- 571
Originally posted by Camp2Win
It's like meta refresh "index" or something. - It's an html file.
-
06-05-2005, 07:52 PM #10Web Hosting Master
- Join Date
- Dec 2003
- Location
- Vancouver BC, eh?
- Posts
- 571
Originally posted by Primalsource
Hi, for some reason that doesn't work with mine.
This what my htaccess looks like:
Crap.html is in the folder that comes before /www
the leading "/" is not "root" in the sense of your home directory account, but in relation to the .htaccess file. So for instance in the /home/user/www/.htaccess if you put a path of /some_path/file.html in the .htaccess file to your new 404 error doc, then you are actually pointing to this file:
/home/user/www/some_path/file.html
-
06-05-2005, 11:54 PM #11Web Hosting Master
- Join Date
- Jun 2004
- Posts
- 2,853
Originally posted by Diaga
In the head:
<meta http-equiv="refresh" content="2;url=http://webhostingtalk.com/">
the 2 - would be the # of seconds to wait after page load (adjust accordingly)
the url, self explanatory
Thank you.