htaccess remove index.php from url

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$$1 [R=301,L]
RewriteRule ^(.*)index$$1 [R=301,L]

Coding Tag

Coding Tag always happy to serve you in Information Technology (IT). Learn HTML, CSS, Javascript, PHP, Android, Digital Marketing, Latest IT News and many more.

Leave a Reply

Notify of