更新时间:2023-02-24 09:20:48
您可以在 DOCUMENT_ROOT /的.htaccess
文件中使用此code:
You can use this code in your DOCUMENT_ROOT/.htaccess
file:
RewriteEngine On
RewriteBase /
# external redirect from actual URL to pretty one
RewriteCond %{THE_REQUEST} \s/+product/search/\?tag=([^\s&]+) [NC]
RewriteRule ^ /%1? [R=302,L,NE]
# internal forward from pretty URL to actual one
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^/]+)/?$ product/search/?tag=$1 [L,QSA]