Home » , » How to remove index.php from url using .htaccess (mod_rewrite)

How to remove index.php from url using .htaccess (mod_rewrite)

Written By Unknown on Senin, 19 Desember 2011 | 08.47

For better SEO optimization and make urls more search engine friendly , remove index.php from URL and make it easier to read.

Remove index.php from URL can be done by writing only two lines in your .htaccess(mod_rewrite in apache) file. Before writing this rule in .htaccess , make sure that your mod_rewrite is enabled(On) in your apache server. 


Most probably mod_rewrite is enabled in Linux server but for windows server , you need to contact hosting people to make mod_rewrite enabled. You can check this by looking in phpinfo().


Below is the Rules which will remove index.php from URL using .htaccess. Look at below links for .htaccess rules.


RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /([^/]+/)*index\.php\
HTTP/ RewriteRule ^(([^/]+/)*)index\.php$ http://www.%
{HTTP_HOST}/ [R=301,NS,L]



Redirect 301 means Moved Permanently so most search engines will remove index.php from URL.
Share this article :

Posting Komentar

 
Support : Creating Website | Johny Template | Mas Template
Copyright © 2011. Kumpulan Kata Broadcast Blackberry - All Rights Reserved
Template Created by Creating Website Published by Mas Template
Proudly powered by Blogger