我有这个 NGINX 配置:
root /var/www/web;
index index.php;
server_name domain.com;
access_log off;
error_log on;
location / {
rewrite ^/(.*)$ /index.php?tag=$1&page=1 last;
}
Run Code Online (Sandbox Code Playgroud)
现在,我想将“domain.com/index.php?tag=1§ion=2&type=3”之类的网址重定向到“domain.com/tag/section/type”
我该怎么做,我应该把代码放在哪里?请帮忙,
谢谢
我已经尝试过:
location / {
rewrite ^/index\.php?tag=(.*)§ion=(.*)&type=(.*)$ /$1/$2/$3 permanent;
rewrite ^/(.*)$ /index.php?tag=$1&page=1 last;
}
Run Code Online (Sandbox Code Playgroud)
但它没有用..