我原来的网址是什么样子的:
localhost/aoc/product.php?pid=2&cname=australia应用Htaccess:
Options +FollowSymlinks
RewriteEngine On
RewriteBase /aoc
RewriteRule ^product-category/([A-Za-z0-9_\-]+)/([A-Za-z0-9_\-]+).html product.php?pid=$1&cname=$2结果Url:
localhost/aoc/product-category/1/australia.html但是我面临的问题是如何传递参数来对页面项进行排序。对于ex,让我传递变量?sort=xxx或&sort=xxx.,如何通过编辑htaccess以最好的方式实现它?
localhost/aoc/product-category/1/australia.html?sort=xxx - Not working
localhost/aoc/product-category/1/australia.html&sort=xxx - Not working我不希望下面的组合看起来很难看,但是在编辑htaccess之后才能工作:
http://localhost/aoc/product-category/1/xxx/australia.html
http://localhost/aoc/product-category/1/australia.html/xxx/请帮我解释一下。
发布于 2016-04-28 07:37:08
若要组合旧查询字符串和新查询字符串,请使用QSA (查询字符串追加)标志。
Options +FollowSymlinks
RewriteEngine On
RewriteBase /aoc
RewriteRule ^product-category/([A-Za-z0-9_\-]+)/([A-Za-z0-9_\-]+).html product.php?pid=$1&cname=$2 [QSA]https://stackoverflow.com/questions/36908069
复制相似问题