摘要: 1、将多个域名指向同一web目录: server_name www.php100.com php100.com; rewrite ^/$ / redirect; 2、将不带www的域名301转向到带www的域名: server_name www.php100.com php100.com; if ( $host != "www.php100.com" ) { rewrite ^/(.*)$ http://www.php100.com/$1 permanent; } nginx重定向规则详细介绍 rewrite命令 nginx的rewrite相当于apache的rewrite 阅读全文
posted @ 2013-07-12 11:18 jackluo 阅读(4755) 评论(0) 推荐(0) 编辑
摘要: server { listen 80; server_name cy.com; index index.html index.htm index.php default.html default.htm default.php; root /home/wwwroot/cy; location / { if (-e $request_filename) { ... 阅读全文
posted @ 2013-07-12 11:09 jackluo 阅读(4550) 评论(2) 推荐(0) 编辑