htaccess remove index.php from url

by Yogesh Khanna 27-May-16

0 5573


To remove or hide index.php from URL link, you have to put the following code in your .htaccess file. After putting this code in your file it will simply hide the index.php from Website's URL.

RewriteEngine On
RewriteBase /

# Removes index.php
RewriteCond %{THE_REQUEST} ^.*/index.php
RewriteRule ^(.*)index.php$ http://example.com/$1 [R=301,L]
RewriteRule ^(.*)index$ http://.example.com/$1 [R=301,L]


Share:

Comments

    No Comments Yet.

Leave a Reply