V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
asing
V2EX  ›  问与答

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

  •  
  •   asing · Dec 17, 2012 · 4102 views
    This topic created in 4890 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   ·   5441 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 35ms · UTC 07:08 · PVG 15:08 · LAX 00:08 · JFK 03:08
    ♥ Do have faith in what you're doing.