php - How to do this URL rewrite? -


basically, when user types in http://www.domain.com/username want go http://www.domain.com/user?u=username. username name of user page want visit. how can this? need make url rewrite? there better way this? on websites involve user pages, can type in youtube.com/channel , facebook.com/username. want able on site. using php user pages.

what need have hypertext access file (.htaccess). file allow use url rewriting. here need put inside file:

rewriteengine on rewriterule ^([^/]*)$ /user?u=$1 [l] 

Comments

Popular posts from this blog

apache - Remove .php and add trailing slash in url using htaccess not loading css -

javascript - jQuery show full size image on click -