php - Using mod_rewrite for user pages -


so now, when use search function search user , go page, this. "http://www.mywebsite.com/profile/?pid=username"

the php on page gets variable, , runs query of information needed.

i love rid of ?pid= part , have "http://www.mywebsite.com/profile/username"

but having trouble understanding of results google on specific url. examples involve php files, i'm using wordpress , embedding php via execphp.

this should work in .htaccess file:

rewriteengine on rewriterule ^/profile/([^/]*)$ /profile/?pid=$1 [l] 

Comments

Popular posts from this blog

c# - Validate object ID from GET to POST -

node.js - Custom Model Validator SailsJS -

php - Find a regex to take part of Email -