【发布时间】:2019-08-12 03:50:09
【问题描述】:
我想将我的网站的 ip 设置为按字母顺序排列的名称(即 http://54.183.131.205 到 http://www.rblog.com)。虽然我已经在 /etc/apache2/sites-available 中配置了我的 rblog.com.conf,启用它并重新加载了我的 apache 服务器,然后添加到我的 /etc/hosts 文件 54.183.131.205 www.rblog.com(之间的标签ip 和网站名称),在我的浏览器中输入 www.rblog.com 不会将我重定向到我的 index.php 文件。但是,请注意,当我在浏览器中输入 ip 地址时,它会将我带到我的 index.php 文件(我相信这意味着我的 rblog.com.conf 文件是正确的?)。
<VirtualHost *:80>
ServerAdmin webmaster@rblog.com
ServerName www.rblog.com
ServerAlias www.rblog.com
DocumentRoot /var/www/html/rblog/public
<Directory /var/www/html/rblog/public>
Options -Indexes +FollowSymLinks +MultiViews
AllowOverride All
Require all granted
<FilesMatch \.php$>
</FilesMatch>
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
【问题讨论】:
-
更改服务器名称 rblog.com
-
@Sahil 我做到了。它仍然不起作用。我也做了下面推荐的一切,但仍然没有用。