Page 1 of 1

.htaccess

Posted: Sun Aug 27, 2006 9:54 am
by tecktalkcm0391
I need some help with this .htaccess stuff for apache.

Code: Select all

ErrorDocument 401 /error.php?error=401 
ErrorDocument 403 /error.php?error=403 
ErrorDocument 404 /error.php?error=404 
ErrorDocument 500 /error.php?error=500 

RewriteEngine on 
RewriteBase / 

RewriteCond %{REQUEST_FILENAME} -f [OR] 
RewriteCond %{REQUEST_FILENAME} -d 
RewriteRule ^.*$ - [S=2] 
RewriteRule ^(.+)/$ $1.php [QSA,L] 

RewriteRule ^us/([A-Za-z]+)$ us.php?state=$1
Ok here are my problems:
1.) When I go to some non existing page like site.com/abc.php it doesn't show my error page for 404 errors. Same for the rest of them.
2.) If I go to site.com/us.php?state=Florida, florida's page comes up but if I go to site.com/us/Florida it doesn't
3.) If I take of the .php from any page it doens't come up it gives me a 404 error (which isn't my 404 error page)


I've been messing with this to long now. I am tried of dealing with this.

Posted: Mon Aug 28, 2006 11:21 am
by pickle
IE only shows custom 404 pages if they're over a certain size. Are you testing this in Firefox too? If this is indeed the problem, output some white (or whatever your background colour is) text to increase the file size.

On your second rule, you've got [QSA,L]. The L means 'last rule' & mod_rewrite stops looking after that. Take out the L.

Have you seen the cheat sheet?