我在nginx中尝试了URL alias
的多种变体,但似乎没有任何效果。 domain.com/store-trans/index.html
有效,但别名domain.com/retail/12/store
不适用
server {
listen 80;
listen 443 default ssl;
root /var/www/html;
include /etc/nginx/conf.d/_redirects;
port_in_redirect off;
proxy_redirect off;
client_max_body_size 60m;
location / {
try_files $uri /index.php?$query_string; # For Drupal >= 7
}
## New Alias
location ~ ^/store-trans/index.html {
alias /retail/12/store;
}
答案 0 :(得分:0)
尝试将alias
更改为return
:
location ~ ^/store-trans/index.html {
return 301 /retail/12/store;
}