How to remove index.php from the website URL in magento?

There is an easy way to remove index.php from your website url only in case mod_rewrite module is enabled on your server. To check this, you may contact your server administrator/hosting provider.

Now please check the below steps to remove index.php from your website url:
Login to your admin panel:

  • Click the System->Configuration tab
  • magento

  • On the appeared screen click “Web” tab under “General” on the left hand side of your admin panel. You will see the below screen:
  • magento2

  • Now open the Search Engines Optiomization tab and set the Use Web Server Rewrites to “Yes”
  • Now open secure tab set “Yes” to Use Secure URL in Frontend
  • Click on Save Confif which is at the top right of the page.
  • Now there is need to create an .htaccess file with the rewrite directives in the root folder of your Magento installation.
  • Tis can be done through control panel File Manager or FTP to create a file

Put the below code into your .htaccess file

In case your Magento is installed in sub-folder, e.g. store (just a naae of sub-folder), you should use the below code:

Save and upload the file.

Now check index.php is successfully removed in your website URL.

That’s it.