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

mysql - FireDac error 314 - but DLLs are in program directory -

git - How to list all releases of public repository with GitHub API V3 -

c++ - Getting C2512 "no default constructor" for `ClassA` error on the first parentheses of constructor for `ClassB`? -