Welcome Guest, Not a member yet? Register   Sign In
Remove index.php from the URL

While surfing through the Internet I saw many videos that show how to remove index.php from the URL.

Why should we do that? Only because of the beauty?

CodeIgniter has not already installed that from HOME if that is important and necessary?

By the way , despite the videos I haven't got it.

You normally do it to get nicer and more search friendly URLs on your website.

To remove the index.php file from your URL you need to
  1. Make sure your server has Apache mod_rewrite enabled
  2. Added needed .htaccess file in the root of your site (normally in the same location as the index.php file). Example code below.
  3. Removed 'index.php' from $config['index_page'] in the config file.

Example of code in your .htaccess file
<IfModule mod_rewrite.c>
   RewriteEngine On
   RewriteBase /
   RewriteCond %{REQUEST_FILENAME} !-f
   RewriteCond %{REQUEST_FILENAME} !-d
   RewriteRule ^(.*)$ index.php?/$1 [L]


Removing index.php from the url will gives your site a better chance to get displayed while using search engines Smile

No it won't, that's a myth.

(This post was last modified: 04-16-2015, 08:15 PM by alenn. Edit Reason: Added SEO guidelines )

(04-16-2015, 02:12 AM)gadelat Wrote: No it won't, that's a myth.
Removing "index.php" can shorten the URL length, and for the sake of cleaner/pretty URL.

Will removing index.php improve SEO of your site?
Found magento SEO article https://blog.udemy.com/magento-seo/ saying that removing index.php will improve the search ranking. How true is that?

I'll based on Google SEO guidelines as I use google search engine most of the time (99.99% of the time):

So teh answer is YES! Removing index.php will improve your site SEO!
Whenever possible, shorten URLs by trimming unnecessary parameters.

Added SEO guidelines for reference:

Theme © iAndrew 2016 - Forum software by © MyBB