nginx如何实现301

基于不同域名之间nginx 301

302需求:

www.111.com/111.html   302到:
www.222.com/222.html

实现:

location ~ /111.html {
         return http://www.222.com/222.html;
      }

301需求:

www.111.com/111.html   301到:
www.222.com/222.html

实现:

location ~ /111.html {

       rewrite ^/(.*)$ http://www.222.com/222.html permanent;

      }

 

转载随意~:陶醉seo » nginx如何实现301

赞 (0)
分享到:更多 ()