asing
V2EX  ›  问与答

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

  •  
  •   asing · Dec 17, 2012 · 4530 views
    This topic created in 5093 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
    andyliu
    Dec 17, 2012
    2
    301定向即可。
    asing
    asing
    OP
    Dec 17, 2012
    3
    我错了!

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