.htaccess - URL Rewrite: PHP variable as directory -


alright, how like:

domain.com/friends.php?id=fred 

into like:

domain.com/fred/friends.php 

previously, have used:

rewriterule ^([a-za-z0-9]+)$ profile.php?id=$1 [l] 

to turn

domain.com/profile.php?id=fred 

into

domain.com/fred 

i know there way it, don't have knowledge of operators put 'friends.php' in rewriterule. help, if explanation made sense.

you're close:

rewriterule ^([a-za-z0-9]+)/friends\.php$ friends.php?id=$1 [l] 

Comments

Popular posts from this blog

php - SPIP: From Tag directly to an article -

jquery - isAjaxRequest always return false -

ruby on rails - In a controller spec, how to find a specific tag in the generated view? -