Jump to content

Friendly URL not working


Recommended Posts

You must enable Friendly URLs under Back Office >> Preferences then
you have to create a blank .htaccess and upload it to your root prestashop folder go to
Back Office >> Tools >> Generators and then hit Generate .htaccess file.

Link to comment
Share on other sites

This is what you have to write in your .htaccess (tested on 1.3.1)

# URL rewriting module activation

RewriteEngine on

RewriteBase /

# Force www

RewriteCond %{HTTP_HOST} ^dominio.es$

RewriteRule (.*) http://www.dominios.es$1 [R=301]

# URL rewriting rules

RewriteRule ^([a-z0-9]+)\-([a-z0-9]+)(\-[a-zA-Z0-9-]*)/([_a-zA-Z0-9-]*)\.jpg$ /img/p/$1-$2$3.jpg [L,E]

RewriteRule ^([0-9]+)(\-[_a-zA-Z0-9-]*)/([_a-zA-Z0-9-]*)\.jpg$ /img/c/$1$2.jpg [L,E]

RewriteRule ^lang-([a-z]{2})/([a-zA-Z0-9-]*)/([0-9]+)\-([a-zA-Z0-9-]*)\.html(.)$ /product.php?id_product=$3&isolang;=$1$5 [L,E]

RewriteRule ^([a-zA-Z0-9-]*)/([0-9]+)\-([a-zA-Z0-9-]*)\.html(.*)$ product.php?id_product=$2$4 [L,E]

RewriteRule ^([0-9]+)\-([a-zA-Z0-9-]*)\.html(.*)$ product.php?id_product=$1$3 [L,E]

RewriteRule ^([0-9]+)\-([a-zA-Z0-9-]*)(.*)$ category.php?id_category=$1 [QSA,L,E]

RewriteRule ^content/([0-9]+)\-([a-zA-Z0-9-]*)(.*)$ cms.php?id_cms=$1 [QSA,L,E]

RewriteRule ^([0-9]+)__([a-zA-Z0-9-]*)(.*)$ supplier.php?id_supplier=$1$3 [QSA,L,E]

RewriteRule ^([0-9]+)_([a-zA-Z0-9-]*)(.*)$ manufacturer.php?id_manufacturer=$1$3 [QSA,L,E]

RewriteRule ^lang-([a-z]{2})/(.*)$ /$2?isolang=$1 [QSA,L,E]

# Catch 404 errors

ErrorDocument 404 /404.php



and ofcourse activale friendly URL in BO.

when uploaded to your host do not forget to change line 5 and 6 with your domain name (if you want WWW rewrite to be enabled)

Link to comment
Share on other sites

×
×
  • Create New...