This still isn't working even if I go to US/New York it doens't work. and its suppost to because if i go to us.php?state=New York... it does work and shows the page.
Also with the .php if i go to anypage and then remove the .php it still doens't show up anything. I get a 404 error.
Mod_Rewrite Questions...
Moderator: General Moderators
- RobertGonzalez
- Site Administrator
- Posts: 14293
- Joined: Tue Sep 09, 2003 6:04 pm
- Location: Fremont, CA, USA
tecktalkcm0391 wrote:This still isn't working even if I go to US/New York it doens't work. and its suppost to because if i go to us.php?state=New York... it does work and shows the page.
Also with the .php if i go to anypage and then remove the .php it still doens't show up anything. I get a 404 error.
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 ^us/([A-Z]+)$ us.php?state=$1 [nocase]
RewriteRule ^(.+)/$ $1.php [QSA,L]
# The above line expects a trailing slash.
# It wont work the same without the slash