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
Password
Register FAQ Members List Search Today's Posts Mark Forums Read

Reply
 
Thread Tools
Old 4-23-12, 09:10 AM   #1
ianlee
Registered
 
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
</Files>
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} !\.
RewriteCond %{REQUEST_METHOD} !POST$
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, 02:31 PM   #2
Builder
Thinkin' out loud again
 
Builder's Avatar
 
Join Date: Nov 2002
Location: Illinois
Posts: 1,958
Reputation: 272
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,
Kevin
__________________
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
Reply

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 07:36 PM.


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