Codeigniter htaccess and configuration when upload

2019-08-31 04:10发布

问题:

I have a server and I made a website using Codeigniter. I used the wamp server to do my project. now I want to upload it to the server I have so I need to change the configurations and the htaccess file. but I don't know what to edit in these files.

autoload: I have changed nothing in this file only $autoload['libraries'] = array('database','session','form_validation'); $autoload['helper'] = array('url','form','array' , 'date');

config: $config['base_url'] = 'http://www.example.com/'; $config['uri_protocol'] = 'AUTO';

database: $db['default']['hostname'] = 'http://www.example.com';

route: $route['(:any)'] = 'my_controller/$1'; $route['default_controller'] = "my_controller"; $route['404_override'] = '';

this is what I have changed in all the configuration files

回答1:

Server requires some times a different htacess

I have found a link with lots of different htaccess main directory examples https://github.com/riwakawebsitedesigns/htaccess_for_codeigniter

This might be able to help you.



回答2:

Here is the step by step tutorial to upload codeigniter app in server. follow the following link. This really helped me. Step By Step guide to Install Codeigniter Website in Server