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

问题描述

我项目的一个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上的/进行此操作。

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)