[英](nginx) Redirect 301 from location to another domain
需要將位置(mydomain.com/x)重定向到另一個域(newdomain.com)
嘗試:
location /x { rewrite ^(.*)$ http://www.newdomain.com redirect; }
不工作......有人可以幫忙嗎?
您可能需要在/x
之后捕獲url部分並在新位置的末尾重寫它:
location /x {
rewrite ^/x(.*)$ http://www.newdomain.com$1 redirect;
}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.