php - The usage of .htaccess to re-write the url -


i have written .htaccess rewrite following urls :

confirmreg.php 

to

http://keralapsctuts.com/confirm-registration.html 

and

 confirmreg.php?code=nsfoh98fkjsdf90 

to

http://keralapsctuts.com/code/62fdd2ac2709877a81ecfd7dde9d2810/confirm-registration.html 

.htaccess rule is

rewriterule confirm-registration\.html$ confirmreg.php [qsa,l] rewriterule code/(.*)/confirm-registration\.html$ confirmreg.php?code=$1 [qsa,l] 

echo not returning value of code

echo "code: ". $_get['code']; 

improved code:

rewriterule ^confirm-registration\.html$ confirmreg.php [qsa,l] rewriterule ^code/([0-9a-z]+)/confirm-registration\.html$ confirmreg.php?code=$1 [qsa,l] 

give rewriterule starting ^

rewriterule ^ 

optionally, more specific in characters want except.

code/([0-9a-z]+)/ 

Comments

Popular posts from this blog

html - Firefox flex bug applied to buttons? -

html - Missing border-right in select on Firefox -

python - build a suggestions list using fuzzywuzzy -