Php 使用codeigniter为不同网站配置虚拟主机

Php 使用codeigniter为不同网站配置虚拟主机,php,apache,http-headers,virtualhost,codeigniter-url,Php,Apache,Http Headers,Virtualhost,Codeigniter Url,我有一个主门户,现在这个门户将被不同的机构使用 我已将apache虚拟主机配置如下: DocumentRoot“C:/xampp/htdocs/portal/exp1.php” ServerName test.exp1.org 命令允许,拒绝 通融 DocumentRoot“C:/xampp/htdocs/portal/exp2.php” ServerName test.exp2.org.in 命令允许,拒绝 通融 现在您可以看到,我创建了不同的索引页面,如exp1.php,exp2.p

我有一个主门户,现在这个门户将被不同的机构使用

我已将apache虚拟主机配置如下:


DocumentRoot“C:/xampp/htdocs/portal/exp1.php”
ServerName test.exp1.org
命令允许,拒绝
通融


DocumentRoot“C:/xampp/htdocs/portal/exp2.php”
ServerName test.exp2.org.in
命令允许,拒绝
通融

现在您可以看到,我创建了不同的索引页面,如exp1.phpexp2.php

在每个索引页中,我都只写过这样的东西

标题(“位置:http://test.exp1.org/exp1.php/login/index/1”

因此,现在将调用登录控制器->索引函数->并将参数设置为1。。因此,根据这个参数,我将加载一个登录页面,相应地为特定的第一研究所

其他exp2.php也是如此

标题(“位置:http://test.exp2.org/exp2.php/login/index/1”

现在,这将调用登录控制器->索引函数->和参数2。。因此,根据这个参数,我将加载一个登录页面,相应地为该特定的第二研究所

当我在浏览器上点击此按钮时,执行了所有这些操作后,它显示了此错误页面没有正确重定向,实际上我希望它根据url中传递的参数加载特定视图

这是我的文件夹结构


“知道我是谁”是我的错误,或者我应该执行哪些步骤来正确重定向我不熟悉CodeIgniter(我使用Laravel),但对我来说,这似乎是apache配置不正确

这是我在httpd-vhost.conf上使用的配置(示例):


服务器管理员webmaster@nudistbeach.com
DocumentRoot“C:/wamp/www/nudistbeach/public/”
ServerName nudistbeach.com
ErrorLog“logs/test laravel error.log”
CustomLog“logs/test laravel access.log”通用
服务器管理员webmaster@revocs.com
DocumentRoot“C:/wamp/www/revocs/public/”
ServerName revocs.com
ErrorLog“logs/test laravel error.log”
CustomLog“logs/test laravel access.log”通用
试着这样做,然后告诉我结果:

<VirtualHost test.exp1.org:80>
    ServerAdmin webmaster@test.exp1.org
    DocumentRoot "C:/xampp/htdocs/portal/exp1.php"
    ServerName test.exp1.org
    ErrorLog "logs/test-laravel-error.log"
    CustomLog "logs/test-laravel-access.log" common
</VirtualHost>

<VirtualHost test.exp2.org:80>
    ServerAdmin webmaster@test.exp2.org
    DocumentRoot "C:/xampp/htdocs/portal/exp2.php"
    ServerName test.exp2.org
    ErrorLog "logs/test-laravel-error.log"
    CustomLog "logs/test-laravel-access.log" common
</VirtualHost>

服务器管理员webmaster@test.exp1.org
DocumentRoot“C:/xampp/htdocs/portal/exp1.php”
ServerName test.exp1.org
ErrorLog“logs/test laravel error.log”
CustomLog“logs/test laravel access.log”通用
服务器管理员webmaster@test.exp2.org
DocumentRoot“C:/xampp/htdocs/portal/exp2.php”
ServerName test.exp2.org
ErrorLog“logs/test laravel error.log”
CustomLog“logs/test laravel access.log”通用
<VirtualHost test.exp1.org:80>
    ServerAdmin webmaster@test.exp1.org
    DocumentRoot "C:/xampp/htdocs/portal/exp1.php"
    ServerName test.exp1.org
    ErrorLog "logs/test-laravel-error.log"
    CustomLog "logs/test-laravel-access.log" common
</VirtualHost>

<VirtualHost test.exp2.org:80>
    ServerAdmin webmaster@test.exp2.org
    DocumentRoot "C:/xampp/htdocs/portal/exp2.php"
    ServerName test.exp2.org
    ErrorLog "logs/test-laravel-error.log"
    CustomLog "logs/test-laravel-access.log" common
</VirtualHost>