|
| Register now to interact with over 11,000 members! Registered users have Posting Privileges, free access to Private Messaging, Email Notifications and more. |
|
|||||||
![]() |
|
|
Thread Tools |
|
|
#1 |
|
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 |
|
|
|
|
|
#2 |
|
Thinkin' out loud again
Join Date: Nov 2002
Location: Illinois
Posts: 1,843
Reputation: 262
|
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!" |
|
|
|
![]() |
| Thread Tools | |
|
|