Skip to content

tasmanwebsolutions/htaccess_for_codeigniter

Repository files navigation

Codeigniter 3 And Up

Read First:

Disclaimer: Please note these .htaccess files some may not work and some may work, it all depends on your Codeigniter Version and Server and Operating System

Note: If you find one that is not on list please create a pull request and add the htaccess that you would like. And also add what OS for ie. linux windows etc.

User Guide For Codeigniter 3 + Codeigniter 3 + Userguide

Removing index.php from url

Setup

1: Choose your .htaccess file, And then place in the main directory but outside of the application folder.

2: Go to application/config/config.php

3: Set your base url as it is NOW RECOMMENDED TO DO SO something like below

$config['base_url'] = "http://localhost/yourprojectname/"; or your domain just Don't leave it blank.

4: Find $config['index_page'] = 'index.php';

5: And replace $config['index_page'] = '';

6: Do not touch the htaccess file in application folder.

7: You may need to configure your routes in application/config/routes.php

Example Routes application/config/routes.php

Note: Some times you do not need to configure your routes.

$route['default_controller'] = 'welcome';

$route['dashboard'] = 'dashboard';

$route['dashboard/(:any)'] = 'dashboard/$1';

Pull Request

You are more than welcome to create a pull request Pull Request If you come across any more htacces examples that might be a good idea to have. If you feel the read me file needs to be updated or improved you can make a pull request also.

About

Codeigniter HTACCESS Removing index.php from URL

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published