Why does index.php show up?
PrestaShop is a program for running an online shop. Its main file is called index.php. When friendly URLs are off, every link points to that file, and it shows in the address. A friendly URL is a clean, readable web address. Compare yourshop.com/index.php?id_product=5 with yourshop.com/blue-shirt. The second one is easier to read and better for search engines.
.htaccess, which tells the server how to handle addresses. Take a backup of your files and database first.Steps
- Log in to your PrestaShop back office.
- Click Shop Parameters in the left menu.
- Click Traffic & SEO. In PrestaShop 1.6 this is Preferences, then SEO & URLs.
- On the SEO & URLs tab, scroll to the box named Set up URLs.
- Set Friendly URL to Yes.
- Set Accented URL as you like. Leave it at No if you are not sure.
- Set Redirect to the canonical URL to 301 Moved Permanently. This sends old links to the new clean ones.
- Click Save.
PrestaShop then writes new rules into your .htaccess file. For this to work, the folder must be writable, and the server must have the Apache rewrite feature on. Hostvento hosting servers normally support this. If you are unsure, ask support.
If index.php is still there
- Go to Shop Parameters, Traffic & SEO again.
- Scroll to the bottom of the page, to the Configure your .htaccess file options (it may be under Tools).
- Click Save again. This asks PrestaShop to rebuild the file.
- Clear the cache from Advanced Parameters, then Performance. Click Clear cache.
- Check that a file named
.htaccessexists in your shop folder. It is a hidden file, so turn on "show hidden files" in your file manager.
Test
Open a product or a category in your shop. The address should have no index.php. If you get a "404 not found" error, switch Friendly URL back to No, save, and ask support to check the rewrite feature.
Quick recap
index.phpshows when friendly URLs are off.- Turn on Friendly URL in Shop Parameters, Traffic & SEO.
- Save so PrestaShop rebuilds
.htaccess. - Clear the cache and test.
- Back up before you start.