PowWeb Forums - The Perfect Community for the Perfect Host  

Register now to interact with over 11,000 members! Registered users have Posting Privileges, free access to Private Messaging, Email Notifications and more.

Go Back   PowWeb Community Forums > The PowWeb Platform > .htaccess / Scheduled Jobs
User Name
Register FAQ Members List Search Today's Posts Mark Forums Read

Thread Tools
Old 4-23-12, 10:10 AM   #1
Join Date: Apr 2012
Location: UK
Posts: 1
Reputation: 0
ErrorDocument in .htaccess not working

I have added the ErrorDocument command to my htaccess file to use my own error pages but it is conflicting with one of the rewrite rules (second section below) and I just keep getting the default browser 404 error page. The rewrite condition line tells it to leave filenames alone and the url to my error page works perfectly when typed into a browser. Can anyone help?

<Files .htaccess>
order allow,deny
deny from all
Options +FollowSymLinks
RewriteEngine on
RewriteBase /
# 301 Redirect all requests that don't contain a dot or trailing slash to
# include a trailing slash
# except for form POSTS
RewriteCond %{REQUEST_URI} !/$
RewriteCond %{REQUEST_URI} !\.
RewriteRule ^(.*) %{REQUEST_URI}/ [R=301,L]

# Rewrites urls in the form of /parent/child/
# but only rewrites if the requested URL is not a file or directory
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.+)$ index.php?page=$1 [QSA]

RewriteCond %{HTTP_HOST} !^www\.safari-club\.co.uk
RewriteRule (.*) http://www.safari-club.co.uk/$1 [R=301,L]

ErrorDocument 404 /errordocs/error404.htm
ianlee is offline   Reply With Quote
Old 4-23-12, 03:31 PM   #2
Thinkin' out loud again
Builder's Avatar
Join Date: Nov 2002
Location: Illinois
Posts: 2,087
Reputation: 291
Did you:
Edit your .htaccess file in a text editor not a word processor?
Add a few blank lines at the end of the file?
Upload in ASCII (text) not Binary?
Upload to the correct folder (i.e. htdocs if you want this to apply to your entire site)?

Asking the "stupid questions" since usually when I have something go wrong it's because I did something that makes me slap my head and say "Well, duh..."

Good luck,
A good friend will come and bail you out of jail...
but a true friend will be sitting next to you saying,
"Damn... that was fun!"
Builder is offline   Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

All times are GMT -4. The time now is 01:45 PM.

Contents ©PowWeb, Inc. ~ vBulletin, Copyright 2000-2007 Jelsoft Enterprises Limited.