...

View Full Version : URL Rewrite Question



theflyingminstr
10-25-2010, 11:03 PM
RewriteEngine On
RewriteRule ^([a-zA-Z0-9_-]+)$ user.php?username=$1
RewriteRule ^([a-zA-Z0-9_-]+)/$ user.php?username=$1

Hi this works ok for:

http://domain/user

but not for:

http://domain/user/

What should I add to make the trailing slash at the end take?

Thanks.


EDIT:

Answer:

RewriteEngine on
RewriteRule ^([^/\.]+)/?$ user.php?username=$1

theflyingminstr
10-26-2010, 01:38 AM
I posted the EDIT as the answer:

EDIT:

Answer:

RewriteEngine on
RewriteRule ^([^/\.]+)/?$ user.php?username=$1


.. but now if I try to go to any folder (ex: http://domain/folder/) it takes me to the mod rewrite setting trying to find a user with that folder name:

RewriteEngine on
RewriteRule ^user/([^/\.]+)/?$ user.php?username=$1 [NC]



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum