Server rentals :: NFOservers.com

Forums

All times are UTC - 8 hours



Author Message
PostPosted: Fri Apr 20, 2012 1:27 pm 
Offline
A semi-regular
A semi-regular

Joined: Sat Jan 08, 2011 8:23 pm
Posts: 19
Hey guys,
I've been trying to create custom error pages (404) without luck.
I uploaded a .htaccess file to my forums root directory, containing the following code:

Code:
ErrorDocument 400 /error/404.php
ErrorDocument 401 /error/404.php
ErrorDocument 402 /error/404.php
ErrorDocument 403 /error/404.php
ErrorDocument 404 /error/404.php
ErrorDocument 500 /error/404.php


Then uploaded a sample 404.php file to my forum/error/ folder.
However when I do this, suddenly my forum (and all pages on the website) return an Internal Service Error which isn't my custom error page, nor should my board suddenly return that error.
Any suggestions?

Cheers!


Top
 Profile  
 
PostPosted: Fri Apr 20, 2012 1:31 pm 
Offline
This is my homepage
This is my homepage

Joined: Sun Jun 26, 2011 8:03 am
Posts: 1129
Think it should be in html.

Quote:
ErrorDocument 403 /403.html

_________________
Visit gspreviews.com And Rate & Review Your Old & Current GSP's
Procon Hosting $2.50/month - aaquacks.com
Find Your GSP Coupons at gspreviews.com/coupons/
Make Money Using Url Shortners at w1z.it


Top
 Profile  
 
PostPosted: Fri Apr 20, 2012 1:33 pm 
Offline
A semi-regular
A semi-regular

Joined: Sat Jan 08, 2011 8:23 pm
Posts: 19
I actually tried that as well (html) with same results. :(


Top
 Profile  
 
PostPosted: Fri Apr 20, 2012 1:43 pm 
Offline
Founder
Founder
User avatar

Joined: Thu Apr 18, 2002 11:04 pm
Posts: 9232
Location: Seattle
Are you certain that the files you are specifying exist in the correct places? Before you specify the ErrorDocument, try accessing them directly, using the same URL that it would -- for instance, based on what you put above, the file would need to be at:

http://yoursite.com/error/404.php

If you put the file into a "forum" subfolder, making the actual URL http://yoursite.com/forum/error/404.php, then you would need the .htaccess to reflect that, like:

ErrorDocument 404 /forum/error/404.php

I tested with a simple .html file on one of our test-hosting sites and it worked correctly for me.


Top
 Profile  
 
PostPosted: Fri Apr 20, 2012 1:55 pm 
Offline
A semi-regular
A semi-regular

Joined: Sat Jan 08, 2011 8:23 pm
Posts: 19
I just tried linking to the file in my browser and the file is indeed there.
I also tried editing the .htaccess file with http://www.mysite.com/error/404.php where mysite is my actual url. However the same problem still persists. My board suddenly becomes inaccessible, being replaced by an Internal Service Error and not my custom 404.php.

Edit: sorry forgot to add that my domain links to the forum folder, so that would be my root folder, no?


Top
 Profile  
 
PostPosted: Fri Apr 20, 2012 2:00 pm 
Offline
Founder
Founder
User avatar

Joined: Thu Apr 18, 2002 11:04 pm
Posts: 9232
Location: Seattle
Is the .htaccess file in the correct format -- straight text, as output by Notepad?

Do you have any other .htaccess that is overriding it and restoring default settings?

Are you using IE to access your site? If so, the Apache docs describe one possible limitation with that: http://httpd.apache.org/docs/2.0/mod/co ... ordocument

ErrorDocument definitely works out of the box.


Top
 Profile  
 
PostPosted: Fri Apr 20, 2012 2:02 pm 
Offline
A semi-regular
A semi-regular

Joined: Sat Jan 08, 2011 8:23 pm
Posts: 19
Yeah I am using a mac so with my text editor it saved as htaccess.rtf
I uploaded it using FileZilla FTP and renamed it to .htaccess


Top
 Profile  
 
PostPosted: Fri Apr 20, 2012 2:03 pm 
Offline
A semi-regular
A semi-regular

Joined: Sat Jan 08, 2011 8:23 pm
Posts: 19
I am using mybb forum software and that comes with an htaccess.txt file. However when opening that it says to use it, you need to rename it to .htaccess, so im assuming that file isnt being used?

There is another .htaccess file in my forum/inc/ directory protecting a config file.


Top
 Profile  
 
PostPosted: Fri Apr 20, 2012 2:04 pm 
Offline
Founder
Founder
User avatar

Joined: Thu Apr 18, 2002 11:04 pm
Posts: 9232
Location: Seattle
If you saved it in rtf format, that explains why it doesn't work. You need to save it as plain text, which will normally have a .txt extension.


Top
 Profile  
 
PostPosted: Fri Apr 20, 2012 2:07 pm 
Offline
A semi-regular
A semi-regular

Joined: Sat Jan 08, 2011 8:23 pm
Posts: 19
Hm sorry, im not typically a mac user, only using it since my PC is currently packed away for a move.
The text editor im using only allows me to save in: RTF, HTML, Word Format, and Word XML Format.
Are any of those the correct file type?

Edit: Sorry, there was a setting within the text editor to save in Plain Text. I'll try that now :D


Last edited by winds on Fri Apr 20, 2012 2:10 pm, edited 1 time in total.

Top
 Profile  
 
PostPosted: Fri Apr 20, 2012 2:08 pm 
Offline
Founder
Founder
User avatar

Joined: Thu Apr 18, 2002 11:04 pm
Posts: 9232
Location: Seattle
None of those would work correctly, so you would need to use a different text editor that allows you to save as plain text.


Top
 Profile  
 
PostPosted: Fri Apr 20, 2012 2:16 pm 
Offline
A semi-regular
A semi-regular

Joined: Sat Jan 08, 2011 8:23 pm
Posts: 19
Ahhh thanks so much John, that was indeed my problem. Works like a charm now :D
Cheers!


Top
 Profile  
 
PostPosted: Fri Apr 20, 2012 3:24 pm 
Offline
Staff
Staff

Joined: Mon Nov 06, 2006 2:55 pm
Posts: 150
Rock on, I am very glad you got that figured out. I knew the .htaccess was right but the rtf issues I never even thought of. Thanks Edge for your help and Winds for following my instructions and posting here :D


Top
 Profile  
 
PostPosted: Fri Apr 20, 2012 3:33 pm 
Offline
A semi-regular
A semi-regular

Joined: Sat Jan 08, 2011 8:23 pm
Posts: 19
Yeah I definitely would have never figured that out haha. Thanks Brendan for recommending I post here. Very useful!


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 14 posts ] 

All times are UTC - 8 hours


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
cron
It is currently Tue May 21, 2013 1:38 am
Powered by phpBB® Forum Software © phpBB Group