how to remove index.php from the url in codeigniter
1. First you need to write the .htaccess file it look like this:-
RewriteEngine On
RewriteCond %{REQUEST_URI} ^/system.*
RewriteRule ^(.*)$ index.php?/$1 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.+)$ index.php?/$1 [L]
2. Remove index.php from config file:
$config['index_page'] = 'index.php';
After removing it look like
$config['index_page'] = '';
3 Run your url without index.php
your url should we:
example.com/controller_name/function_name/arguments
1. First you need to write the .htaccess file it look like this:-
RewriteEngine On
RewriteCond %{REQUEST_URI} ^/system.*
RewriteRule ^(.*)$ index.php?/$1 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.+)$ index.php?/$1 [L]
2. Remove index.php from config file:
$config['index_page'] = 'index.php';
After removing it look like
$config['index_page'] = '';
3 Run your url without index.php
your url should we:
example.com/controller_name/function_name/arguments
No comments:
Post a Comment