【问题标题】:Domain working fine with http:// but not working with www域可以正常使用 http:// 但不能使用 www
【发布时间】:2017-04-14 09:10:35
【问题描述】:

我已经购买了一个与http://example.com 一起正常工作的域,但通过 www.example.com 将其重定向到 (example.com/www.example.com) 它也与 www.example.com 一起工作的解决方案是什么http://example.com

【问题讨论】:

  • 您需要在域名注册商的 DNS 设置中将 A-Record 指向您的 IP。将主机 www 指向您服务器的 IP。

标签: dns web


【解决方案1】:

在 htaccess 中只需更改此设置即可解决问题

RewriteEngine on
RewriteCond %{HTTP_HOST} ^www.example.com [NC]
RewriteRule ^(.*)$ http://example.com/$1 [L,R=301,NC]

【讨论】:

    猜你喜欢
    • 2017-10-13
    • 2019-05-23
    • 2019-04-27
    • 2019-04-29
    • 2016-10-14
    • 1970-01-01
    • 2012-09-15
    • 2020-04-01
    • 2023-03-23
    相关资源
    最近更新 更多