php - Rewrite Rule not catching strings -


this rewrite rule works fine number variables, not work strings

rewriterule ^\d+$ user.php?user=$0 [l,qsa] 

who make rule accepts example:

www.mydomain.com/user/andremendes

right accepts if user/12334 or number.

how make accepts strings , numbers?

try :

rewriterule ^([a-za-z0-9_-]+)/?$ user.php?user=$1 [l,qsa] 

to match alphanumbric characters in uri need following regex pattern.

[a-za-z0-9_-] 

Comments

Popular posts from this blog

c++ - Difference between pre and post decrement in recursive function argument -

php - Nothing but 'run(); ' when browsing to my local project, how do I fix this? -

php - How can I echo out this array? -