Questions tagged «rackspace»

17
Nginx从无到www到www和www到无www
我按照教程在Rackspace云上使用nginx,并且已经在网上搜索,到目前为止无法进行排序。 由于SEO和其他原因,我希望www.mysite.com在.htaccess中像往常一样转到mysite.com。 我的/etc/nginx/sites-available/www.example.com.vhost配置: server { listen 80; server_name www.example.com example.com; root /var/www/www.example.com/web; if ($http_host != "www.example.com") { rewrite ^ http://example.com$request_uri permanent; } 我也尝试过 server { listen 80; server_name example.com; root /var/www/www.example.com/web; if ($http_host != "www.example.com") { rewrite ^ http://example.com$request_uri permanent; } 我也试过了。第二次尝试都给出了重定向循环错误。 if ($host = 'www.example.com' ) { rewrite ^ …
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.