Mod Rewrite Issue

robfrew

Well-Known Member
#1
I used to use the following rewrite rule in .htaccess but now it is not working correctly...

1. RewriteRule ^([a-zA-Z0-9_-]+)$ u.php?$1
2. RewriteRule ^([a-zA-Z0-9_-]+)/$ u.php?$1

1. This rule should take http://www.domain.com/user to http://www.domain.com/u.php?user

2. This rule should take http://www.domain.com/user/ to http://www.domian.com/u.php?user (This one checks for trailing slash)

Rule 1 works. Rule 2 does not, it points to http://www.domain.com/user/u.php?user

It used to work but now it doesn't, we didn't change anything except upgrade to latest versions. Any ideas?
 

mistwang

LiteSpeed Staff
#2
We could not reproduce it in our lab, both rule work as expected.

But any way, you can change the second rewrite rule to

RewriteRule ^([a-zA-Z0-9_-]+)/$ /u.php?$1
 
Top