Flash Sale:75% Off Hosting + Free DomainEnds in13h47m14sView Plans
Hostvento logoHostvento

Remove index.php from your PrestaShop web addresses

This guide shows how to get clean web addresses in PrestaShop, so your links do not have index.php in them.

CMS and Apps2 min read13 steps

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.

Warning: This changes a file called .htaccess, which tells the server how to handle addresses. Take a backup of your files and database first.

Steps

  1. Log in to your PrestaShop back office.
  2. Click Shop Parameters in the left menu.
  3. Click Traffic & SEO. In PrestaShop 1.6 this is Preferences, then SEO & URLs.
  4. On the SEO & URLs tab, scroll to the box named Set up URLs.
  5. Set Friendly URL to Yes.
  6. Set Accented URL as you like. Leave it at No if you are not sure.
  7. Set Redirect to the canonical URL to 301 Moved Permanently. This sends old links to the new clean ones.
  8. 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

  1. Go to Shop Parameters, Traffic & SEO again.
  2. Scroll to the bottom of the page, to the Configure your .htaccess file options (it may be under Tools).
  3. Click Save again. This asks PrestaShop to rebuild the file.
  4. Clear the cache from Advanced Parameters, then Performance. Click Clear cache.
  5. Check that a file named .htaccess exists 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.php shows 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.