php - Double Parameter URL Rewrite -


i have following url double parameters , first time double parameter rewrite.

my url: http://localhost/b2b/post?post_id=1&post_subject=test

i'd rewrite to: http://localhost/b2b/post/post_id/1/post_subject/test

my .htaccess is:

options +followsymlinks -multiviews # turn mod_rewrite on rewriteengine on rewritebase /  rewritecond %{request_method}  !=post rewritecond %{the_request} ^[a-z]{3,}\s([^.]+)\.php [nc] rewriterule ^ %1 [r,l,nc] rewritecond %{request_filename}.php -f rewriterule ^ %{request_uri}.php [l] rewritecond %{request_filename} !-f rewritecond %{request_filename} !-d  <files ~ "^(.*)\.(inc|tpl|sql)$">     order deny,allow     deny </files> 

you should write :

rewritecond %{request_filename} !-f  rewritecond %{request_filename} !-d  rewriterule ^post/([a-z0-9-_]+)/([a-z0-9-_]+)/([a-z0-9-_]+)/([a-z0-9-_]+)$  /post.php?$1=$2&$3=$4 [l] 

Comments

Popular posts from this blog

javascript - RequestAnimationFrame not working when exiting fullscreen switching space on Safari -

Python ctypes access violation with const pointer arguments -