如何显示网站而不是ip/index.html

how to show site instead of ip/index.html

本文关键字:ip html index 网站 何显示 显示      更新时间:2023-09-26

我有

  • dns服务器在windows server 2003
  • 我已经在"主区域(。com)"中创建了一个域
  • 我使用"xampp"作为主机
  • 我的服务器ip是"192.168.1.8"
  • 我的域名是www.mysite.com,我给了它服务器的ip

问题是:

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

我要找的是:

dns或xampp的一种方法:

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

由于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