Reputation: 1
Good day, I am a newbie programmer of codeigniter. I just getting start testing the tutorial guide of codeigniter. Making the Home.php, about.php, and insert/view data in database.
I would like to ask, how I can remove the index.php in the url? I try many approve result with the same question im just asking. making .htaccess with the sample code in tutorial, youtube tutorial, and answer in this stackoverflow. I just making the basic tutorial of codeigniter but when I delete the index.php in the URL, the page cannot found my about.php, or /news/create.
by the way Im using wamp server. Sorry if my english is too bad. Thanks in advance.
Upvotes: 0
Views: 752
Reputation:
First make sure the mod rewrite module is enabled on wamp go to the
Apache > Apache modules
Scroll down list to rewrite module enable it.
Restart wamp.
Then try this .htaccess and add it to the main directory.
.htaccess
Options +FollowSymLinks
Options -Indexes
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]
Here are some more htaccess available Click Here
Directory
application
system
.htaccess
index.php
Then on your config.php file add base url, DO NOT LEAVE IT BLANK.
$config['base_url'] = 'http://localhost/project/';
$config['index_page'] = '';
Upvotes: 1