php - htaccess RewriteRule with Parameters -


i'm trying make rewriterule.

i want make this; surfer types

[host]/ttr/ttr4cmd/register/check_screenname?screenname=[parameter] 

browser adress bar shows same adress,but surfer sees page;

[host]/ttr/ttr4cmd/register/check_screenname.php?screenname=[parameter] 

so,i wrote simple htaccess file generator this;

rewritecond %{query_string} (^|&)screenname=($|&) rewriterule ^ttr/ttr4cmd/register/check_screenname$ /ttr/ttr4cmd/register/check_screenname.php?screenname=&%{query_string} 

but when go adress,it gives me 404 error , says

ttr/ttr4cmd/register/check_screenname not found.

please me this. thank :)

edit: did this,and worked. ^^

rewriterule ^ttr/ttr4cmd/register/check_screenname?$ ttr/ttr4cmd/register/check_screenname.php?$1 [qsa,l] 

i think need qsa http://httpd.apache.org/docs/2.4/rewrite/flags.html#flag_qsa

so example

rewritecond %{query_string} .*screenname.* rewriterule ^/ttr/ttr4cmd/register/check_screenname /ttr/ttr4cmd/register/check_screenname.php [qsa] 

here can find intro intro mod_rewrite http://httpd.apache.org/docs/2.4/rewrite/intro.html


Comments