帮忙写一条nginx rewrite规约

WBOY
Release: 2016-06-13 12:13:11
Original
1088 people have browsed it

帮忙写一条nginx rewrite规则
我服务器上有多个域名,现在需要把其中的一个a.com域名进行rewrite处理,需要把所有的目录都重定向首页a.com,除了static目录。

我之前这么写的,没效果。。。
if ( $host ~ 'a.com/' ){
rewrite ^/(?!static)/.* http://a.com permanent;
}
------解决思路----------------------
我也想知道,怎样不写某个目录的规则。

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
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!