0
votes

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.

1
// Edit .htacess file // RewriteEngine on RewriteBase /project/ RewriteCond $1 !^(index\.php|images|robots\.txt) RewriteRule ^(.*)$ /project/index.php/$1 [L] - Arun
What are the .htaccess settings. Have you put mod rewrite settings to ignore index.php in the URL. For this to work you will also have to ensure mod rewrite is enabled in the Apache/php settings - nitigyan
My current .htaccess reads as follows: <IfModule mod_rewrite.c> RewriteEngine On RewriteBase /websitename.com/ RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ index.php?/$1 [L] </IfModule> <IfModule !mod_rewrite.c> # If we don't have mod_rewrite installed, all 404's ErrorDocument 404 /index.php </IfModule> - GrayFox5

1 Answers

0
votes

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