通过Apache重写规则追加查询字符串重写、字符串、规则、Apache

2023-09-02 00:39:16 作者:遗忘你的爱

我怎么能改写如下:

http://www.mydomain.com/my-page.html 以 http://www.mydomain.com/my-page.html?type=1

试过了,没有任何运气如下:

 重写规则/car-covers.html$ /car-covers.html?type=$1 [R = 301,L]

重写规则^汽车covers.html $汽车covers.html?型= $ 1 [QSA,L]
 

解决方案

 重写规则^ html页面/([^/.]+)?$的index.php行动= search_refine&放?;类型= $ 1 [L]
 
Apache大师中,Rewrite 伪静态 设置示例

How can I rewrite the following:

http://www.mydomain.com/my-page.html to http://www.mydomain.com/my-page.html?type=1

Tried the following without any luck:

RewriteRule /car-covers.html$ /car-covers.html?type=$1 [R=301,L]

RewriteRule ^car-covers.html$ car-covers.html?type=$1 [QSA,L]

解决方案

RewriteRule ^html page/([^/.]+)?$ index.php?action=search_refine&type=$1 [L]