简体   繁体   中英

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. In this case, I am dealing with setting up a Codeigniter website on a different server. 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/ ';

and index_page is:

$config['index_page'] = '';

with the uri as:

$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:

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'] = ''; // Leave it empty so that codeigniter can guess it by itself, set $config['index_page'] = 'index.php'; and $config['uri_protocol'] = 'AUTO'; after that open application/config/autoload.php and then add url helper class to autoload 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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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