|
#1
|
|||
|
|||
|
Greetings!
I've just purchased an account and uploaded my site, including custom error pages. I've gone to the control panel and see all of my code when I go to the 404 error page, but when I 'test' it by going to http://iphost/~username/test.html (with my actual address inserted), I don't get my custom error page. I've tried saving it as 404.shtml and 404.html -- if I go to http://iphost/~username/404.html the page shows up, but if I type a page that doesn't exist, it doesn't show up. I'm wondering if I have the pages saved in the wrong directory or something.. wouldn't seem so since the code I imported shows up in the control panel window. I'm just trying to figure out what I need to do to use my custom html error page with my account. I'm trying to get everything in order prior to changing my dns servers. Thanks! P.S. I thought about opening a ticket, but thought this is more of a FAQ type issue, but didn't find anything on the topic in the knowledgebase. |
|
#2
|
|||
|
|||
|
I have a 401.shtml and it works. I can't see anything in my .htaccess file that references my 401 file, so maybe it's just the .shtml suffix that it needs?
Sorry if that's not the answer. Somebody will surely have the answer to this once Christmas is over.... |
|
#3
|
||||
|
||||
|
There should be an .htaccess file in your documentroot with at least this line:
Code:
ErrorDocument 404 /404.html |
|
#4
|
||||
|
||||
|
And another setup.
You can use shtml, html, htm, or PHP as an error page. I have mine with a 5 sec delay. Code:
<meta http-equiv="Refresh" content="5;url=http://www.yourdomain.com/"> You can use your imagination as to what to say before the delay sends them back. Also, if you use the Cpanel to set your error pages, and if you have a canned program you setup for that domain that uses the .htaccess file, it will overwrite it, so you will have to manually edit your .htaccess file. Here is a sample of my .htaccess file, located in public_html/ on all my accounts. The "SetEnvIfNoCase User-Agent" are unwanted leeching harvesters. This one probably needs updating. Code:
RewriteEngine On ErrorDocument 401 /401.html ErrorDocument 403 /403.html ErrorDocument 404 /404.html ErrorDocument 500 /500.html SetEnvIfNoCase User-Agent "^EmailSiphon" bad_bot SetEnvIfNoCase User-Agent "^EmailWolf" bad_bot SetEnvIfNoCase User-Agent "^ExtractorPro" bad_bot SetEnvIfNoCase User-Agent "^CherryPicker" bad_bot SetEnvIfNoCase User-Agent "^NICErsPRO" bad_bot SetEnvIfNoCase User-Agent "^Teleport" bad_bot SetEnvIfNoCase User-Agent "^EmailCollector" bad_bot SetEnvIfNoCase User-Agent "^LinkWalker" bad_bot SetEnvIfNoCase User-Agent "^Zeus" bad_bot |
|
#5
|
||||
|
||||
|
|
|
#6
|
||||
|
||||
|
Quote:
|
|
#7
|
|||
|
|||
|
Haha, that DOS 404 page is awesome.
__________________
|
|
#8
|
|||
|
|||
|
:-/ Well, I now have a .htaccess file and my 404.html files defined. I copied the content for the .htaccess and it didn't work, so I deleted the "RewriteEngine On" line and tried again.. and it still didn't work. It tells me the file wasn't found and:
"Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request." I have put the .htaccess in my public_html folder and in my root folder along with the 404.html file in both locations. (Initially only had it in the public_html folder because I thought that's where it'd go, but added it to the main root thinking maybe that was at issue). Is this perhaps something that will only work after my dns has propogated? I REALLY wanted to see it work beforehand so I can appropriately direct my visitors if I've messed up something in the move. Thanks for any additional insights or suggestions you may have. |
|
#9
|
||||
|
||||
|
I went to cPanel->Error pages and clicked "404", added some text in the text area and saved it as "404.shtml".
Tfe file "404.shtml" appears to be in public_html directory and there's nothing in .htaccess, and it works as expected. Quote:
http://IP/~username/nonexistingfile.htm here and it did NOT work. |
|
#10
|
|||
|
|||
|
Thanks quietFinn,
Hi went ahead and bit the bullet and changed my dns settings. Now that the domain name is actually pulling off the site, the 404 works just fine. It's interesting that it wouldn't work with the temporary URL though. ![]() So, looks like I'm switched over and working well. SandyKC |
![]() |
| Bookmarks |
| Thread Tools | |
|
|