htaccess 重写 url 参数

htaccess rewrite url parameter

我想重定向

http://localhost:8080/mypproject/?supplier=test123

http://localhost:8080/myproject/?product_cat=test123

但是我不知道怎么...

您可以在 /myproject/.htaccess 文件中使用此代码:

RewriteEngine On
RewriteBase /myproject/

RewriteCond %{QUERY_STRING} ^supplier=([^&]+) [NC]
RewriteRule ^/?$ ?product_cat=%1 [L,R=301]