【问题标题】:htaccess root domain and sub domain directionhtaccess 根域和子域方向
【发布时间】:2015-11-16 04:56:17
【问题描述】:

您好,您能帮我解决这个问题吗?因为我不知道我应该如何解决它。

如果我写 mysite.com/australia/ 或 mysite.com/australia/something 错误 404 - PAGE NOT FOUND 但如果我写 www.mysite.com/australia/ 网站是完全打开的,我会遇到问题

如果我这样写我的子域名 www.test.mysite.com/ 它会显示 Server not found 但如果我尝试 test.mysite.com/ 或照片,我会遇到另一个问题。 mysite.com/ 然后网站完全打开 我该如何解决这种问题?

【问题讨论】:

    标签: php apache .htaccess dns server


    【解决方案1】:

    您需要编辑 apache conf 文件并添加服务器别名:

    <VirtualHost *:80>
    # This first-listed virtual host is also the default for *:80
    ServerName www.example.com
    ServerAlias example.com 
    DocumentRoot "/www/domain"
    </VirtualHost>
    

    见:http://httpd.apache.org/docs/2.4/vhosts/name-based.html

    【讨论】:

      猜你喜欢
      • 2014-06-24
      • 2012-11-18
      • 2022-01-15
      • 1970-01-01
      • 1970-01-01
      • 2013-04-23
      • 1970-01-01
      • 2017-01-23
      • 2013-11-22
      相关资源
      最近更新 更多