.htaccess - Rewrite rules for page and user profile -
i can't figure out how rewrite url
http://localhost/site/page.php?id=[pagetitle]
to
http://localhost/site/page/title
and user profiles
http://localhost/site/profile.php?username=username
to
http://localhost/site/profile/username
this code i'm using:
rewriteengine on rewritecond %{request_filename} !-f rewritecond %{request_filename} !-d rewriterule ^profile(.*)$ profile.php?username=$1 rewriterule ^(.*)$ page.php?title=$1
this rewrite input localhost/site/page/title loacalhost/site/page.php?id=[pagetitle]
rewriterule ^localhost/site/(.+)$ site/page.php?id=$1 rewriterule ^localhost/site/profile/(.+)$ site/profile.php?username=$1
Comments
Post a Comment