Home > Backend Development > PHP Tutorial > nginx does not redirect www to www domain name

nginx does not redirect www to www domain name

WBOY
Release: 2016-07-30 13:29:49
Original
1460 people have browsed it

nginx without redirection from www to www domain name

Here, if it is a single redirection, use redirect, if it is a permanent jump, use permanent, here use permanent

{

                                                                                       listen

               server_name xxx.com www.xxx.com;

Index index.html index.php;

root/data/www/wwwroot;

If ($ http_host! ~ "^www.xxx.com $") {

E REWRITE ^(.*) Http://www.xxx.com $1 permanent;

}

... ...        }

Copyright Statement: This article is an original article by the blogger and may not be reproduced without the blogger's permission.
The above introduces the redirection of nginx without www to www domain name, including the relevant content. I hope it will be helpful to friends who are interested in PHP tutorials.

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template