在Apache虚拟主机中使用/服务器名称

时间:2020-09-13 04:22:15

标签: apache apache2 virtualhost

我项目的一个URL需要具有下面的URL castingforprod.localhost/casting是从我的apache虚拟主机文件中配置的:

<VirtualHost *:80>
        DocumentRoot /storage/projects/casting/
        ServerName  castingforprod.localhost/casting

        <Directory /storage/projects/casting/>
                AllowOverride All
                Order allow,deny
                Allow from all
                Require all granted
        </Directory>
</VirtualHost>

我还添加了

127.0.0.1 castingforprod.localhost/casting

在我的/etc/hosts文件中。

但是点击http://castingforprod.localhost/casting给我404错误。设置完配置后,我将重新启动apache服务器。

如何使用serverName上的/进行此操作。

0 个答案:

没有答案