duanbozhong9689 2017-04-25 07:47
浏览 35

.htaccess重写变量排序规则

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. e.g.

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...

  • 写回答

1条回答 默认 最新

  • dpdkqls6399 2017-04-25 07:53
    关注

    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.

    评论

报告相同问题?

悬赏问题

  • ¥15 C++ yoloV5改写遇到的问题
  • ¥20 win11修改中文用户名路径
  • ¥15 win2012磁盘空间不足,c盘正常,d盘无法写入
  • ¥15 用土力学知识进行土坡稳定性分析与挡土墙设计
  • ¥70 PlayWright在Java上连接CDP关联本地Chrome启动失败,貌似是Windows端口转发问题
  • ¥15 帮我写一个c++工程
  • ¥30 Eclipse官网打不开,官网首页进不去,显示无法访问此页面,求解决方法
  • ¥15 关于smbclient 库的使用
  • ¥15 微信小程序协议怎么写
  • ¥15 c语言怎么用printf(“\b \b”)与getch()实现黑框里写入与删除?