标签:http nbsp man 域名 $1 make 跳转 需求 根目录
访问域名
www.adc.com/image 自动跳转到 www.adc.com/make/image
这个如何写
这种需求有多种方法可以实现:
1. 利用Nginx rewrite 内部跳转实现:
location /image {
rewrite ^/image/(.*)$ /make/image/$1 last;
}
2.利用alias映射
location /image {
alias /make/image; #这里写绝对路径
}
3.利用root映射:
location /image {
root /make;
}
4.利用nginx的permanent 301绝对跳转实现
location /image {
rewrite ^/image/(.*)$ http://www.adc.com/make/image/$1;
}
5.判断uri实现
if ( $request_uri ~* ^(/image)){
rewrite ^/image/(.*)$ /make/image/$1 last;
}
标签:http nbsp man 域名 $1 make 跳转 需求 根目录
原文地址:https://www.cnblogs.com/jcici/p/9272167.html