I want to access my URL\'s without index.php in CodeIgniter. Here is my Blog controller
class Blog extends CI_Controller {
pub
How to removed index.php from url has been asked so many times, It is the same as what is for codeigniter 2 and 3.
For Xampp With Codeigniter Windows
Find application/config/config.php
Replace This
$config['base_url'] = "";
With This
$config['base_url'] = "your-project-url";
Replace This
$config['index_page'] = "index.php"
With This
$config['index_page'] = ""
In main directory create file called .htaccess
I use code below works fine for me in xampp in windows. More htacces here
Options +FollowSymLinks
Options -Indexes
Order deny,allow
Deny from all
DirectoryIndex index.php
RewriteEngine on
RewriteCond $1 !^(index\.php|images|robots\.txt)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L,QSA]
Note: make sure your controllers are like example Welcome.php instead of welcome.php also you might need to create new routes in your route.php if remove index.php