问题
I have a url domain/p1/p2/p3/?order=p4
I would like to convert this into all parameter using htaccess
like: domain?var1=p1&var2=p2&var3=p3&order=p4
This is what I'm using right now:
RewriteRule ^([^/.]+)/([^/.]+)/([^/.]+)/\order=[A-Za-z]?$ page.php?var1=$1&var2=$2&var3=$3&order=$4 [NC,L]
回答1:
You don't need to match query parameter ?order=p4
here and you will need QSA
flag:
RewriteRule ^([^/.]+)/([^/.]+)/([^/.]+)/?$ page.php?var1=$1&var2=$2&var3=$3 [QSA,L]
来源:https://stackoverflow.com/questions/28970908/htaccess-directory-with-parameter-to-url-parameters