简体   繁体   中英

.htaccess Rewrite rules for sorting variable

php to display results. URLs are like that...

www.example.com/Vehicle/Car
www.example.com/Vehicle/Car/Maruti

Rewrite rule so far i have applied for that are and these are working perfectly for me.

RewriteRule ^([a-zA-Z0-9_-]+)/([a-zA-Z0-9_-]+)/([a-zA-Z0-9_-]+)$ /list.php?type1=$1&type2=$2&type3=$3 [L,QSA]
RewriteRule ^([a-zA-Z0-9_-]+)/([a-zA-Z0-9_-]+)$ /list.php?type1=$1&type2=$2 [L,QSA]

Now i want to sort all my results on basis of price, model and visits and want to add sort variable at the end of url to sort results. eg

www.example.com/Vehicle/Car/?sort='sort-value'
www.example.com/Vehicle/Car/Maruti/?sort='sort-value'

What Rewrite rule do i need to apply for that ?? Thanks in advance...

Your current rewrite rules should already provide for what you want.

You have specified the QSA flag which will append the sort='sort-value' to your rewritten value.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM