Removing index.php from URLs | Coding Tag

htaccess remove index.php from url

Last Updated by Yogesh Khanna 27-May-19

0 13922

To remove or hide index.php from the URL link, you have to put the following code in your .htaccess file.

After putting this code in your .htaccess file it will simply hide the index.php from the 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]

If you think I have missed out on anything in this blog and if this blog helped you, so please comments and I will surely update that with this list.

Do share this blog with your social accounts, so that your friends can also reach to this list


Leave a Reply

    Waiting for your comments