In this blog, we will see how to remove
index.php from base URL of a Magento store.
↣ To remove “index.php” from the web-site URL, the mod_rewrite module should be enabled on your server.
In case, mod_rewrite is not enabled, follow these steps:
- Run this command
sudo a2enmod rewrite
- Edit your httpd configuration and write following lines
<Directory /var/www/> Options Indexes FollowSymLinks AllowOverride All Require all granted </Directory>
- Now, restart apache service using this command (the commands might change based on the OS that you use)
sudo service apache2 restart
You need to following these steps:
- Log in to your Magento store admin and go to the Store ⇒ Configuration section. (In case of Magento 1, it’s System ⇒ Configuration)
- Then click on the Web tab in the leftside menu.
- Expand the Search Engines Optimization tab and set the Use Web Server Rewrites option to Yes.
- Then, go to the Base URLs (Secure) tab and set the Use Secure URLs on Storefront option to Yes, too. Click on the Save Config button.
- Make sure your Secure and Unsecure base urls should end with “/”.