Remove index.php or home from front page Prestashop

I have found some of the solutions from official Prestashop forums that will remove that extra url like index.php or home from your main page. I mean it is quite annoying for me. Here is how to do it :

Then scroll down till you find Set Up URLs tab

Now click and make it as Friendly URL and leave others as it is.

friendly url

For linux you have to do  create an .htaccess file in the root folder of Ps installation, Now you have to give it read and write permission. To do so within your ftp program choose the permissions settings by clicking on .htaccess file and then select all and now follow the same steps as shown above. It will auto create a htaccess for it. Now change again the read- write permission to 664.

Sample file 

 

Now in case you have older version of Prestashop and you want a solution for good 301 Redirecting.

Here is the best post that i found

 

First of all turn off all the Seo configuration of your old and new website. To do so you have to turn Seo Friendly URL off and create a new htaccess file, now open notepad or any other text pad and follow these steps

On the top write

start with

RewriteEngine on

Then add the flowing code for every:

For example if your old page is http://www.example.com/shop/category.php?id_category=37
and your new page is http://example.com/category.php?id_category=1000
Use this command
RewriteCond %{QUERY_STRING} ^id_category=(37)$RewriteRule ^category\.php$ http://example.com/category.php?id_category=1000 [L,R=301]
For product page

If your old page is http://www.example.com/shop/product.php?id_product=5
and the new one is http://example.com/product.php?id_product=151005

Add this string to your htaccess

RewriteCond %{QUERY_STRING} ^id_product=(5)$RewriteRule ^product\.php$ http://example.com/product.php?id_product=151005 [L,R=301]

For cms page
Old http://www.example.com/shop/cms.php?id_cms=9
New http://example.com/cms.php?id_cms=7
Write

RewriteCond %{QUERY_STRING} ^id_cms=(9)$RewriteRule ^cms\.php$ http://example.com/cms.php?id_cms=7 [L,R=301]
To change index page
Index.php-page

Old page : http://www.example.com/shop/index.php
new url : http://example.nl/index.php
Add

Redirect 301 /shop /
Now save these commands as .htaccess file and put in root folder of old site. In total your file will look like

RewriteEngine onRewriteCond %{QUERY_STRING} ^id_category=(37)$RewriteRule ^category\.php$ http://example.com/category.php?id_category=1000 [L,R=301]RewriteCond %{QUERY_STRING} ^id_cms=(5)$RewriteRule ^cms\.php$ http://example.com/cms.php?id_cms=7 [L,R=301]RewriteCond %{QUERY_STRING} ^id_product=(5)$RewriteRule ^product\.php$ http://example.com/product.php?id_product=151005 [L,R=301]

For complete redirect

 

For full site try this file

 

References

https://www.prestashop .com/forums/topic/119653-redirecting-301-how-to/

Enjoy this blog? Please spread the word :)