asing
V2EX  ›  问与答

怎么强制用户访问www域名?

  •  
  •   asing · Dec 17, 2012 · 4128 views
    This topic created in 4899 days ago, the information mentioned may be changed or developed.
    apache开启了 www.example.com example.com
    域名也绑定了两个域名

    怎么强制用户使用www.example.com

    例如用户输入example.com 跳转到www.example.com

    谢谢:)
    5 replies    1970-01-01 08:00:00 +08:00
    andyliu
        2
    andyliu  
       Dec 17, 2012
    301定向即可。
    asing
        3
    asing  
    OP
       Dec 17, 2012
    我错了!

    好了。
    mgplus
        4
    mgplus  
       Dec 17, 2012
    URL Rewrite:
    RewriteCond %{HTTP_HOST} ^www\.(.*)
    RewriteRule (.*) http://%1/$1 [R=301,L]
    0racleTink
        5
    0racleTink  
       Dec 17, 2012
    301
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   885 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 38ms · UTC 19:31 · PVG 03:31 · LAX 12:31 · JFK 15:31
    ♥ Do have faith in what you're doing.