我有nginx安裝,它是作爲一個站點的代理工作。請參考下面Nginx - 帶www的URL不重定向
proxy_cache_path /tmp/cache levels=1:2 keys_zone=STATIC:10m inactive=10m max_size=1g;
server {
listen 80;
server_name domain.com www.domain.com;
client_max_body_size 20M;
location/{
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_pass http://domainserver.com:8000;
proxy_connect_timeout 600;
proxy_send_timeout 600;
proxy_read_timeout 600;
send_timeout 600;
}
location = /xmlrpc.php {
deny all;
access_log off;
log_not_found off;
}
location = /home-garden {
rewrite 301 http://domain.com/category/forsale/home-and-garden/;
}
}
我想要做什麼配置是
URL http://www.domain.com/home-garden應該重定向到http://domain.com/new-home-garden
此外, http://domain.com/home-garden應該重定向到http://domain.com/new-home-garden
讓我知道如果我提供了足夠的信息,如果有人可以幫我
什麼是'重寫HTTP 301://domain.com/category/forsale/home-and-garden/;'?你的意思是「回報」? –