简体   繁体   English

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

[英]Menu redirects only go to the index.php page with codeigniter

Codeigniter is a first for me so I hope I am clear in my explanation. Codeigniter对我来说是第一位,所以我希望我的解释清楚。 In this case, I am dealing with setting up a Codeigniter website on a different server. 在这种情况下,我要处理在其他服务器上建立Codeigniter网站的问题。 I was getting forbidden access errors but have since corrected this, I think. 我认为我收到了禁止访问的错误,但此后已对此进行了更正。

I've worked out the base url in config file to: 我已经计算出配置文件中的基本网址为:

$config['base_url'] = ' http://websitename.com/ '; $ config ['base_url'] =' http: //websitename.com/';

and index_page is: 和index_page是:

$config['index_page'] = ''; $ config ['index_page'] ='';

with the uri as: 与uri为:

$config['uri_protocol'] = 'AUTO'; $ config ['uri_protocol'] ='AUTO';

The links from the menu are not redirecting properly. 菜单中的链接未正确重定向。 They simply reload the index page. 他们只是重新加载索引页面。 In Firebug, this is what I see as one of the page links: 在Firebug中,这是页面链接之一:

https://websitename.com/index.php?module/rekap_tl https://websitename.com/index.php?module/rekap_tl

Perhaps this is enough to understand the trouble here. 也许这足以了解这里的麻烦。 I am working with this on a live server. 我正在实时服务器上使用它。

Any and all help is greatly appreciated. 任何帮助都将不胜感激。

you can configure codeigniter like $config['base_url'] = ''; 您可以像$config['base_url'] = '';一样配置codeigniter $config['base_url'] = ''; // Leave it empty so that codeigniter can guess it by itself, set $config['index_page'] = 'index.php'; //将其保留为空,以便Codeigniter可以自行猜测,设置$config['index_page'] = 'index.php'; and $config['uri_protocol'] = 'AUTO'; $config['uri_protocol'] = 'AUTO'; after that open application/config/autoload.php and then add url helper class to autoload helper $autoload['helper'] = array('url'); 之后,打开application/config/autoload.php ,然后将url helper类添加到自动加载助手$autoload['helper'] = array('url'); after that you can use in you menus "<?php echo base_url(); ?>index.php/controller/method/args" hope this may help 之后,您可以在菜单中使用"<?php echo base_url(); ?>index.php/controller/method/args"希望这会有所帮助

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM