0

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.

2

1 Answer 1

1

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.

enter image description here

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'] = '';
Sign up to request clarification or add additional context in comments.

2 Comments

good day sir.. if my wamp server have no rewrite module? wer do I download it?
If you download fresh one from here wampserver.com/en should be included when use install it was for me.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.