Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
Showing results for
error 404 in .htaccess not working
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Plusnet Community
- :
- Forum
- :
- Help with my Plusnet services
- :
- Everything else
- :
- error 404 in .htaccess not working
error 404 in .htaccess not working
10-04-2008 9:19 AM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
All of a sudden the info in my .htaccess file regarding 404 errors have stopped working.
The two relevant lines in my .htaccess file are...
ErrorDocument 403 /forbidden.php
ErrorDocument 404 /errors.php
If I mistype a page address, I get a standard 404 page error not my own and equally if I enter wrong credentials i get a standard 'forbidden' page and not my own custom one.
Can anyone tell me whats gone wrong suddenly? I cannot think of anything i have changed which would effect this.
Many thanks
The two relevant lines in my .htaccess file are...
ErrorDocument 403 /forbidden.php
ErrorDocument 404 /errors.php
If I mistype a page address, I get a standard 404 page error not my own and equally if I enter wrong credentials i get a standard 'forbidden' page and not my own custom one.
Can anyone tell me whats gone wrong suddenly? I cannot think of anything i have changed which would effect this.
Many thanks
Message 1 of 4
(1,518 Views)
3 REPLIES 3
Re: error 404 in .htaccess not working
18-04-2008 9:02 AM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
I've solved this myself now.
I've changed the lines in my .htaccess file as follows:-
ErrorDocument 403 <My Full URL>/forbidden.php
ErrorDocument 404 <My Full URL>/errors.php
It was failing because there are subdirectories that the user might be in at the time that he navigates to a broken link and so the errors.php may not be in the same directory (relative) as he is in at the time.
It was a stupid oversight on my part
I've changed the lines in my .htaccess file as follows:-
ErrorDocument 403 <My Full URL>/forbidden.php
ErrorDocument 404 <My Full URL>/errors.php
It was failing because there are subdirectories that the user might be in at the time that he navigates to a broken link and so the errors.php may not be in the same directory (relative) as he is in at the time.
It was a stupid oversight on my part
Message 2 of 4
(398 Views)
Re: error 404 in .htaccess not working
20-04-2008 12:30 AM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
Thanks for posting the Solution 
Always useful for Future Reference.
I was going to reply to this, but I didn't have the time.
I thought it was along the lines of a bad path somewhere,
when I read it but I assumed .htaccess's worked from their root path,
and assumed all your pages were in the root path.
Jim,

Always useful for Future Reference.
I was going to reply to this, but I didn't have the time.
I thought it was along the lines of a bad path somewhere,
when I read it but I assumed .htaccess's worked from their root path,
and assumed all your pages were in the root path.
Jim,
Message 3 of 4
(398 Views)
Re: error 404 in .htaccess not working
20-04-2008 9:16 AM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
Your root (home) folder is not the root of the filesystem so doing /filename.php does not refer to a file in your root folder but in the root of the filesystem.
Your root folder is actually /files/homeX/username where X is a number. So you need to use the full path to refer to the error document in the .htaccess file. So it would be /files/homeX/username/error.html.
To find you full path just use pwd from the shell prompt.
Your root folder is actually /files/homeX/username where X is a number. So you need to use the full path to refer to the error document in the .htaccess file. So it would be /files/homeX/username/error.html.
To find you full path just use pwd from the shell prompt.
Message 4 of 4
(398 Views)
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Plusnet Community
- :
- Forum
- :
- Help with my Plusnet services
- :
- Everything else
- :
- error 404 in .htaccess not working