【问题标题】:How to exclude other domain from server url?如何从服务器 url 中排除其他域?
【发布时间】:2019-09-01 15:52:02
【问题描述】:

我在 aws linux 服务器中有两个项目,例如:

/var/www/html/codeigniter-project/
/var/www/html/other-project/

而codeigniter项目的url是:

http://ip/

如果我打开像http://ip/other-project 这样的其他项目,那么它会显示Internal Server Error。 那么,我如何从 url 中排除这个文件夹或如何打开其他项目,如http://ip/other-project

【问题讨论】:

    标签: linux .htaccess codeigniter amazon-ec2 server


    【解决方案1】:

    按照@Tk42421 的建议,为每个项目设置虚拟服务器。 http://ip/project1 :将文档根目录指向一个文件夹, http://ip/project2 : 将文档根目录指向另一个文件夹

    以下是如何操作的指南:virtual servers digitalocean

    【讨论】:

      【解决方案2】:

      您使用的是正确的方法。我认为其他项目的代码存在一些问题。做一件事,复制 codeigniter-project 并将其重命名为 codeigniter-project2 然后尝试使用http://ip/codeigniter-project2 运行它

      【讨论】:

      • 没有其他项目不在任何框架中,代码是核心 php,如果我使用像 http://ip/codeigniter-project/ 这样的 codeigniter,那么其他项目正在工作。我在 httpd.conf ( Changed DocumentRoot ) 中将 http://ip/codeigniter-project 更改为 http://ip/。可能这个问题是htaccess产生的。
      • 在这些情况下,我所做的是为每个项目设置一个虚拟服务器,所以我在 apache http://ip/project1http://ip/project2 中都有自己的配置
      猜你喜欢
      • 2021-01-28
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-11-19
      • 2012-10-26
      • 1970-01-01
      • 1970-01-01
      • 2015-06-24
      相关资源
      最近更新 更多