0

I am creating a small website and would like to remove the index.php and the controller welcome from the URL string. My mod_rewrite looks like;

<IfModule mod_rewrite.c>

 RewriteEngine On
 RewriteBase /

 // remove index.php / welcome

</IfModule>

My application will look like;

index($pagename){

//pull from database where page name is $pagename
// get head, insert $pagename, insert footer etc


}
1

1 Answer 1

1

For removing index.php update your .htaccess file with the following code :

 RewriteEngine on RewriteBase /
 RewriteCond %{REQUEST_FILENAME} !-f 
 RewriteCond %{REQUEST_FILENAME} !-d 
 RewriteRule ^(.*)$ index.php?/$1 [L]

Hope it works in removing index.php

Sign up to request clarification or add additional context in comments.

3 Comments

please also add instructions to change $config['index_page'] = 'index.php' to empty string in config.php.
just remove index.php like $config['index_page'] = ' ';
i was asking you to update your answer, so that is covers all the cases. :)

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.