【问题标题】:how to show site instead of ip/index.html如何显示站点而不是 ip/index.html
【发布时间】:2015-08-01 18:23:01
【问题描述】:

我有

  • windows server 2003 上的 dns 服务器
  • 我在“主要区域 (.com)”中创建了一个域
  • 我使用“xampp”来托管网站。
  • 我的服务器 ip 是“192.168.1.8”
  • 我的域是 www.mysite.com 我给它服务器的 ip。

问题是:

当我打开 www.mysite.com 时,它只是 显示包含索引和我的 html 的文件夹 文件而不是显示网站。

我正在寻找的是:

一种来自 dns 或 xampp 的方法:

例如当我们输入 www.google.com 它向我们显示谷歌不是**索引

【问题讨论】:

    标签: javascript web-services dns xampp ip


    【解决方案1】:

    由于 Apache 服务器没有配置显示文件,您必须手动将此代码添加到 .htaccess 或 php.ini 文件中:

    DirectoryIndex yourpreferedfilename.ext index.php index.html
    

    http://www.htaccess-guide.com/directoryindex-uses/

    为了安全起见,将此代码添加到 .htaccess 或 php.ini 文件中:

    Options -Indexes
    

    http://www.thesitewizard.com/apache/prevent-directory-listing-htaccess.shtml

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-11-08
      • 1970-01-01
      • 1970-01-01
      • 2018-06-23
      • 2017-07-05
      相关资源
      最近更新 更多