Please help me for this mod_rewrite result
how i can get u开发者_如何转开发sing .htaccess
http://www.domain.com/artist.php?userid=2&name=username
to
http://www.domain.com/saquib
please help
You can easily rewrite requests like /saquib
internally to /artist.php?name=saquib
by using a rule like this:
RewriteRule ^[a-z]+$ artist.php?name=$0
But the problem with your example is the user ID that cannot be obtained from the requested URI path. So unless you use a path that also contains the user ID (e.g. /2-saquib
), the user names need to be unique to identify the users just by their user name.
By the way: You should think about using a unique path prefix as some kind of namespace for your users like /users/…
.
精彩评论