404 Error Page isn't working

Status
Not open for further replies.

gcstuff

New Member
Messages
20
Reaction score
0
Points
0
I am trying to customize my 404.shtml page for www.geocachingstuff.com.

When I go to geocachingstuff.com/404.shtml it does what I want, redirect to the homepage. If I go to www.geocachingstuff.com/anything it goes to an x10 404 page. /anything isn't a directory obviously.

I am not sure what's wrong. Any help would be much appreciated.
Thanks!
 

gcstuff

New Member
Messages
20
Reaction score
0
Points
0
Thanks for the help! I can't see if it works, because FTP is taking so long/not working....it has been slow/not working since yesterday.
 

gcstuff

New Member
Messages
20
Reaction score
0
Points
0
If I type in a directory that I don't have, it shows "404.shtml" on the page. I can't change that page
 

Zubair

Community Leader
Community Support
Messages
8,766
Reaction score
305
Points
83
It now will redirect within 5 seconds to my homepage. So now, if I go to a page that isn't there, it doesn't show that (404.shtml)

The problem is still in 404.shtml

Post the code of this file. I will try to fix it.
 

gcstuff

New Member
Messages
20
Reaction score
0
Points
0
The 403 forbidden works with the same code.

Code:
<HTML>
REDIRECTING
<HEAD>
<META HTTP-EQUIV="refresh" CONTENT="5;URL=http://www.geocachingstuff.com/">
</HEAD>
</HTML>

.htaccess looks like this:

Code:
ErrorDocument 404 404.shtml
 

Zubair

Community Leader
Community Support
Messages
8,766
Reaction score
305
Points
83
The 403 forbidden works with the same code.

Code:
<HTML>
REDIRECTING
<HEAD>
<META HTTP-EQUIV="refresh" CONTENT="5;URL=http://www.geocachingstuff.com/">
</HEAD>
</HTML>
.htaccess looks like this:

Code:
ErrorDocument 404 404.shtml
Paste this code in 404.shtml and see if it work
Code:
The Page You are Looking for <!--#echo var="REQUEST_URI" -->does not exsist..
Please Check it again...<br />

<!--#echo var="REMOTE_ADDR" --><br />
<!--#echo var="HTTP_HOST" --><br />
<!--#echo var="HTTP_USER_AGENT" -->
 

descalzo

Grim Squeaker
Community Support
Messages
9,373
Reaction score
326
Points
83
1. Use

Code:
ErrorDocument 404  /404.shtml

2. Unless you are going to use SSI commands (like Zubair's code does), don't use .shtml as an extension. Use .html
 

gcstuff

New Member
Messages
20
Reaction score
0
Points
0
I was using .shtml since that was the default. Under advanced tools, Error Pages on Cpanel

I will use html and see if that works
 

descalzo

Grim Squeaker
Community Support
Messages
9,373
Reaction score
326
Points
83
gcstuff said:
I will use html and see if that works

If you don't change the .htaccess entry so there is a backslash in front of the filename, it won't work.
The .shtml change is because a) shtml pages are a potential security risk and b) they have to be parsed by the server every time they are sent, a waste of server resources if you are not going to use SSI.
 

Zubair

Community Leader
Community Support
Messages
8,766
Reaction score
305
Points
83
Problem Solved.

***Thread Closed***
 
Status
Not open for further replies.
Top