
1 pimin 2014-08-23 14:52:27 +08:00 如果你坚持跳转,domain.com/about只是过去式,阵痛罢了 |
2 roychan 2014-08-23 15:07:58 +08:00 不会吧……我都是 rewrite 301 permanent |
3 Tink PRO 怎么可能,应该是会跳转的啊 |
6 Lucius 2014-08-23 15:43:23 +08:00 rewrite 301 |
8 Lucius 2014-08-23 15:50:23 +08:00 @raycloud RewriteEngine On RewriteCond %{HTTP_HOST} ^v2ex.com [NC] RewriteRule ^(.*)$ http://www.v2ex.com/$1 [L,R=301] |
9 maikcn 2014-08-23 15:52:04 +08:00 nginx ``` server { listen 80; server_name example.com; return 301 http://www.example.com$request_uri; } ``` |
10 hzqim 2014-08-23 15:58:29 +08:00 example.com用来短地址服务,访问example.com直接跳转到www.example.com,访问example/xxx就跳转到缩短的地址。 server{ listen 80; server_name example.com rewrite ^()$ http:www.example.com permanent; } server{ listen 80; server_name www.example.com; ... } |
13 lenye 2014-08-23 16:03:21 +08:00 |
14 yjsslab 2014-08-23 17:30:28 +08:00 为什么还用 www 呢?不时髦了。 |
16 maikcn 2014-08-23 18:02:50 +08:00 @raycloud 一般都让 nginx 反向代理内部的 tomcat 一定要让 tomcat 识别的话,一般在Java程序中用 urlrewrite 的工具来做跳转,大概这样 http://nematodes.org/martin/2010/02/04/301-permanent-redirect-with-tomcat-howto/ |
18 14 2014-08-23 18:51:31 +08:00 CNAME到裸域名 |
19 Exin 2014-08-23 19:50:21 +08:00 好久不用www了…… |
20 Laobai 2014-08-23 20:10:16 +08:00 重定向 |
21 lecher 2014-08-23 20:15:34 +08:00 小站不用www无所谓。 但是如果域名下面有多个产品,还是用www比较好。 因为裸域名下面的cookie是全域名通用的。就是说 v2ex.com下面设置的cookie,到other.v2ex.com的页面上,也是可以使用的。 大部分 CDN 也不支持裸域。 Rio 在知乎上有专门的解释。裸域名好处不多,但是坏处缺不少。 http://www.zhihu.com/question/20414602 |