Mod Rewrite Issue

Discussion in 'General' started by robfrew, Oct 12, 2008.

  1. robfrew

    robfrew New Member

    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?
  2. mistwang

    mistwang LiteSpeed Staff

    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

Share This Page