To Remove from action file name in url usign php -
hello every 1 new in concept of url rewriting. have url
"http://localhost/htaccess/formname/my-parameter-value"
but want
"http://localhost/htaccess/my-parameter-value"
in advance
here code
#options +followsymlinks -multiviews # turn mod_rewrite on rewriteengine on rewritecond %{the_request} ^[a-z]{3,}\s/+(.*?)(?:\+|%20|\s)+(.+?)\shttp [nc] rewriterule ^ /%1-%2 [l,ne,r=302] # externally redirect /dir/foo.php?name=123 /dir/foo rewritecond %{the_request} ^get\s([^.]+)\.php\?name=([^&\s]+) [nc] rewriterule ^ %1/%2? [r,l] # internally forward /dir/foo/12 /dir/foo.php?name=12 rewritecond %{request_filename} !-d rewritecond %{request_filename}.php -f rewriterule ^(.+?)/([^/]+)?$ $1.php?name=$2 [l,qsa]
Comments
Post a Comment