I have tried this before without results.
I want to all 404 errors automatically send the viewer to the index page.
How can I do this? I had gone through it once but it never worked.
Thanks,
Michael
This is a discussion on Custom Error Pages in the Open Discussion & Chit-chat forum
I have tried this before without results.
I want to all 404 errors automatically send the viewer to the index page.
How can I do ...
I have tried this before without results.
I want to all 404 errors automatically send the viewer to the index page.
How can I do this? I had gone through it once but it never worked.
Thanks,
Michael
I'm sure there's a better way to do it, but adding this to your 404 page should work too.
<?
header ("Location: index.php");
exit;
?>
Tried that and it isn't working.
Where are my error pages kept and what permission should they have?
Thanks
You can also just put the following meta tag that will refresh to a page of your choice after X seconds...
as shown above, 10 is the number of seconds that the browser waits before refreshing to the jaguarpc.com sitePHP Code:<META HTTP-EQUIV=Refresh CONTENT="10; URL=http://www.jaguarpc.com/">
Log into your control panel... click on 'Error Pages' and edit the custom error pages to your heart's content.Originally posted by Michael
Tried that and it isn't working.
Where are my error pages kept and what permission should they have?
Thanks
Make sure that your error pages are bigger then 512bytes or Internet Explorer will use its default 404 error page.
You can choose to use PHP as mike mentioned above, but you need to change the extension of the 404 page to *.php.Originally posted by Michael
This is for an error page.
The simpler way would be to use meta tags to refresh the visitor to your index page after 0 seconds.
But it is not working.
I have even called my 404.shtml page directly and it did not redirect.
this is what I had,
<!--#echo var="HTTP_HOST" -->
<!--#echo var="HTTP_USER_AGENT" -->
<?
header ("Location: index.html");
exit;
?>
This I placed in 404.shtml in my public_html directory
ok - instead of using PHP, I think it would be best if you used meta tags as I mentioned before.
Follow these steps closely:
1) Log into your Control panel
2) Click on error pages
3) Click on 404 ' wrong page'
4) copy and paste the following code into the text box for the 404:5) Change www.yoursite.com to your own domainPHP Code:<META HTTP-EQUIV=Refresh CONTENT="0; URL=http://www.yoursite.com/">
6) Important Make sure that your 404.shtml file is at least 512 bytes in size - this is because Internet Explorer defaults to its own 404 page if a custom 404 page is not found on the site.
You should just add in a paragraph of random text so that you can fill the 512 bytes.
I just tested these steps and was able to make the 404 work.
I know I sound dumb I just could never get this to work.
I am trying it![]()
Let me know if you're still having trouble with it, I'll be glad you make you a sample 404.shtml file so that you can see the steps I've listed above finished.
Don't worry about 'sounding dumb' - questions are questions and I am here to help with anything that I have had experience with
g'luck
Ok, its working.
I didn't know about that 512bytes thing.
Thanks all for the help it really is nice since the domain used to be owned by others and there are a lot of links going to non existing pages now.
I am wonder something though,
If a SE runs through the links from other sites, won't the redirection from a meta tag cause trouble? Would redirecting through .htaccess or something be better?
Thanks all,
Michael
In your case, since the redirecting through meta tags are only used for error pages, I don't think it should be too much of a concern.
Also, if you're worried thats going to effect your site in search engines, then you can try using .htaccess to directly point error pages to your index page. Not too sure about this though...
I got the .htaccess to work also.
Is there a danger in using my full path http://www.tcog.org/index.html
in my .htaccess? I am wondering because I read someone that
you shouldn't.
Michael
I personally don't think there is any danger.
But problem would be if you wanted to change the domain name of the site or use the same .htaccess file within your sites.
If you used relative paths, this wouldn't be a problem.
Copyright © 2011 JaguarPC.com
Bookmarks