Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/266.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
菜单重定向仅使用codeigniter转到index.php页面_Php_Codeigniter - Fatal编程技术网

菜单重定向仅使用codeigniter转到index.php页面

菜单重定向仅使用codeigniter转到index.php页面,php,codeigniter,Php,Codeigniter,Codeigniter是我的第一个,所以我希望我的解释清楚。在本例中,我处理的是在不同的服务器上设置Codeigniter网站。我曾经遇到过被禁止访问的错误,但我想我已经纠正了这一点 我已经计算出配置文件中的基本url: $config['base\u url']='' 索引页面为: $config['index_page']='' uri为: $config['uri_protocol']='AUTO' 菜单中的链接未正确重定向。它们只是重新加载索引页。在Firebug中,这是我看到的页面链接

Codeigniter是我的第一个,所以我希望我的解释清楚。在本例中,我处理的是在不同的服务器上设置Codeigniter网站。我曾经遇到过被禁止访问的错误,但我想我已经纠正了这一点

我已经计算出配置文件中的基本url:

$config['base\u url']=''

索引页面为:

$config['index_page']=''

uri为:

$config['uri_protocol']='AUTO'

菜单中的链接未正确重定向。它们只是重新加载索引页。在Firebug中,这是我看到的页面链接之一:

也许这足以理解这里的麻烦。我正在一个实时服务器上处理这个问题


非常感谢您的帮助。

您可以像这样配置codeigniter
$config['base\u url']=''
//将其留空,以便codeigniter可以自己猜测,设置
$config['index_page']='index.php'
$config['uri_protocol']='AUTO'
然后打开
application/config/autoload.php
,然后将url助手类添加到autoload助手
$autoload['helper']=array('url')
之后,您可以在菜单中使用
“index.php/controller/method/args”
希望这对您有所帮助

//编辑.htacess文件//RewriteBase上的RewriteEngine/project/RewriteCond$1^(index\.php | images | robots\.txt)RewriteRule^(.*)$/project/index.php/$1[L]什么是.htaccess设置。您是否在URL中设置了忽略index.php的mod rewrite设置。为了实现这一点,您还必须确保在Apache/php设置中启用mod rewrite。我当前的.htaccess如下所示:RewriteBase/websitename.com/RewriteCond%{REQUEST_FILENAME}-f RewriteCond%{REQUEST_FILENAME}-重写规则^(.*)$index.php?/$1[L]#如果我们没有安装mod_rewrite,所有404的ErrorDocument 404/index.php我真的不理解你评论的最后一部分:之后你可以在菜单中使用“index.php/controller/method/args”,我已经按照你的建议设置了配置。它在标题中显示url,但没有显示正确的结果。显示的URL是:但index.php仍然显示。模块和rekap_tl是什么?您能解释一下吗?为什么要使用问号?“这些模块用于显示手机应用程序记录的数据库数据。我只是尝试在新服务器上重新创建站点。我仍在熟悉Codeigniter及其实现方式。至少,我已经告诉过你,你的链接应该像这个网站名。come/index.php/controllerName/MethodName/Arguments[可选]如果你用这种格式指定你的url,那么你的代码就会工作