php - htaccess for links with ? and non numeric parameter -
in .htaccess have:
<ifmodule mod_rewrite.c> rewriteengine on rewritebase / rewriterule ^name/body/test$ http://%{http_host}/new_name [l,r=301] #1 - ok rewriterule ^name-450$ http://%{http_host}/name450[l,r=301] #2 - ok rewriterule ^name.php?id=13&new_id=8$ http://%{http_host} [l,r=301] #3 - not working rewriterule ^data/others/aaa/all/bbb/all/ccc/750$ http://%{http_host}/new_data [l,r=301] #4 - not working rewriterule ^data/others/aaa/1/bbb/2/ccc/750$ http://%{http_host}/new_data [l,r=301] #5 - ok rewriterule ^?num=123$ http://%{http_host} [l,r=301] #6 - not working </ifmodule>
why 3, 4 , 6 not working? how can create it?
rules 3 , 6 end beingness follows:
rewriteengine on rewritebase / rewritecond %{query_string} id=13&new_id=8 rewriterule ^name.php$ http://%{http_host}/? [l,r=301] rewritecond %{query_string} ^num=123$ rewriterule .* http://%{http_host}/? [l,r=301]
rule 4 looks fine me can suggest you're not testing properly.
php apache .htaccess mod-rewrite
No comments:
Post a Comment