Friendly URLs are critical to SEO (search engine optimization) and this functionality should be enabled in Prestashop as soon as possible. Prestashop changes URLs like www.yourshop.com/product.php?id_product=1 to www.yourshop.com/music-ipods/1-ipod-nano.html if friendly URL is enabled. The second URL gives much more information to search engines.
1. Check your server
OK first of all make sure your website is hosted in Apache web server and Apache mod_rewrite module is enabled. You can ask your hosting provider or check it like this. Create file phpinfo.php and add this line:
<?php phpinfo(); ?>
Upload this file to your website’s root directory and check it in your browser: www.yourshopname.com/phpinfo.php
You should see similar information:
OK now we have to generate .htaccess file. If you enable friendly URL before generating .htaccess file your shop visitors will see blank page – we do not want this. Go to back office
2. Generate .htaccess file
Select Friendly URL check box. You can also enter some .htaccess rules in Specific configuration field by your self. Be careful with Specific configuration field – misconfiguration may cause errors in your shop.Now press Generate .htaccess file button. You should see Update successful message.
3. Check .htaccess file
Check if your .htaccess file is generated in your shop’s root directory. Some FTP clients like Filezilla hides .htaccess file so make sure your FTP client is able to show files which start with dot like .htaccess. If you use Filezilla press Server->Force showing hidden files – now you should see hidden files on your server. You should see something like this:
If you do not see .htaccess file create it manually, upload to your Prestashop’s root directory and update permissions to 777 and repeat the 2 step. If you use Filezilla just click right mouse button on .htaccess file and select “File permissions” – it looks like:
Sometimes it happens that it is not possible to change permissions with FTP client (ftp user) then you should contact your hosting provider and ask to resolve this problem.
4. Enable friendly URL
Now if .htaccess file is created go to Preferences->SEO & URLs area and scroll down to URLs Setup section:
Select Friendly URL and press save. I really recommend to enable Automatically redirect to Canonical url option – this will improve your SEO. You can read more about this problem here.
5. Check your shop
Now go to your shop and try to navigate in product categories. If you see blank page then perhaps .htaccess file is missing. If you see “HTTP Error 500 Internal server error” then your .htaccess file is miss-configured – try to regenerate it. Some modules requires additional rules in .htaccess files – read modules installation instructions and follow them for the installation.
That’s it! I hope you’ll find this tutorial helpful.