doupinge9055 2015-09-07 14:02 采纳率: 100%
浏览 56

apache虚拟主机多个目录

I have setup a virtual host in apache with multiple directories for www.abc.com and abc.com/api which I need to points towards different directory

<VirtualHost *:8080>
            DocumentRoot "/var/www/html/api/"
            ServerName www.abc.com
            ServerAlias www.abc.com
            DirectoryIndex index.php
            # Other directives here
            # Other directives here
            Alias /api/ "/var/www/html/public/"

            <Directory "/var/www/html/public">

            </Directory>
        </VirtualHost>

Its working when I go to www.abc.com/api/ but when I move beyond that www.abc.com/api/v1/ I got the error Not Found

The requested URL /var/www/html/public/index.php was not found on this server.

How to fix the issue?

  • 写回答

1条回答 默认 最新

  • dsomm80482 2015-09-07 14:14
    关注

    I suppose you are using an MVC framework. If that's the case you need to configure your routing path in order to access your desired file.

    评论

报告相同问题?

悬赏问题

  • ¥15 多址通信方式的抗噪声性能和系统容量对比
  • ¥15 winform的chart曲线生成时有凸起
  • ¥15 msix packaging tool打包问题
  • ¥15 finalshell节点的搭建代码和那个端口代码教程
  • ¥15 Centos / PETSc / PETGEM
  • ¥15 centos7.9 IPv6端口telnet和端口监控问题
  • ¥20 完全没有学习过GAN,看了CSDN的一篇文章,里面有代码但是完全不知道如何操作
  • ¥15 使用ue5插件narrative时如何切换关卡也保存叙事任务记录
  • ¥20 海浪数据 南海地区海况数据,波浪数据
  • ¥20 软件测试决策法疑问求解答