php - Mod_Rewrite URL -
current url:
http://localhost/blog/profile.php?username=username&page_type=following
i want be:
http://localhost/blog/profile/username/following
current .htaccess:
rewriteengine on checkcaseonly on checkspelling on rewritecond %{request_filename} !-f rewritecond %{request_filename} !-d rewritecond %{request_filename} !-l rewriterule ^profile/(.*)$ /blog/profile.php?username=$1&page_type=$2 [qsa,l]
is possible rewrite way? or there better way?
you need 2 capture groups:
rewriterule ^profile/(.*?)/(.*)$ /blog/profile.php?username=$1&page_type=$2 [qsa,l]
Comments
Post a Comment