Jump to content

[SOLVED] Friendly URL's


Recommended Posts

Friendly URLs are used for Search Engine Optimisation purposes. It makes the URL more readable by putting the category name and product name in the URL. For example, the friendly URL on my site is http://www.nethercottconstructions.com/prestashop-modules/8-ajax-accordion-sliding-categories.html instead of the default http://www.nethercottconstructions.com/product.php?id_product=8.

Link to comment
Share on other sites

Friendly URLs are important to shop owners who want their site to appear high in the Google rankings. When creating new categories, products and CMS pages, the shop owner should enter appropriate keywords to make their content easier to find on Google.

Link to comment
Share on other sites

  • 2 months later...
Friendly URLs are important to shop owners who want their site to appear high in the Google rankings. When creating new categories, products and CMS pages, the shop owner should enter appropriate keywords to make their content easier to find on Google.


But why if i put on the frindly urls the photos disapear from the website? Do i have to regerate the photos? Thanks in advance for the help
Link to comment
Share on other sites

You need to upload a blank .htaccess file to the root of Prestashop of your server and give it chmod 666 permissions. Then go to Tools > Generators and choose "Generate .htaccess file".


Ok, i will do that, but you think my htacess is ok?:

# .htaccess automaticaly generated by PrestaShop e-commerce open-source solution
# http://www.prestashop.com - http://www.prestashop.com/forums

# URL rewriting module activation
RewriteEngine on

# URL rewriting rules
RewriteRule ^([a-z0-9]+)\-([a-z0-9]+)(\-[_a-zA-Z0-9-]*)/([_a-zA-Z0-9-]*)\.jpg$ /publico/img/p/$1-$2$3.jpg [L,E]
RewriteRule ^([0-9]+)(\-[_a-zA-Z0-9-]*)/([_a-zA-Z0-9-]*)\.jpg$ /publico/img/c/$1$2.jpg [L,E]
RewriteRule ^lang-([a-z]{2})/([a-zA-Z0-9-]*)/([0-9]+)\-([a-zA-Z0-9-]*)\.html(.*)$ /publico/product.php?id_product=$3&isolang;=$1$5 [L,E]
RewriteRule ^lang-([a-z]{2})/([0-9]+)\-([a-zA-Z0-9-]*)\.html(.*)$ /publico/product.php?id_product=$2&isolang;=$1$4 [L,E]
RewriteRule ^lang-([a-z]{2})/([0-9]+)\-([a-zA-Z0-9-]*)(.*)$ /publico/category.php?id_category=$2&isolang;=$1 [QSA,L,E]
RewriteRule ^([a-zA-Z0-9-]*)/([0-9]+)\-([a-zA-Z0-9-]*)\.html(.*)$ /publico/product.php?id_product=$2$4 [L,E]
RewriteRule ^([0-9]+)\-([a-zA-Z0-9-]*)\.html(.*)$ /publico/product.php?id_product=$1$3 [L,E]
RewriteRule ^([0-9]+)\-([a-zA-Z0-9-]*)(.*)$ /publico/category.php?id_category=$1 [QSA,L,E]
RewriteRule ^content/([0-9]+)\-([a-zA-Z0-9-]*)(.*)$ /publico/cms.php?id_cms=$1 [QSA,L,E]
RewriteRule ^([0-9]+)__([a-zA-Z0-9-]*)(.*)$ /publico/supplier.php?id_supplier=$1$3 [QSA,L,E]
RewriteRule ^([0-9]+)_([a-zA-Z0-9-]*)(.*)$ /publico/manufacturer.php?id_manufacturer=$1$3 [QSA,L,E]
RewriteRule ^lang-([a-z]{2})/(.*)$ /publico/$2?isolang=$1 [QSA,L,E]

# Catch 404 errors
ErrorDocument 404 /publico/404.php

Thanks Rocky, you rules, thanks for all
Link to comment
Share on other sites

Your .htaccess file looks fine. Perhaps it is a server configuration issue. Do you use Apache or IIS? The .htaccess file that PrestaShop generates only works with Apache.


Thanks for your response, it uses apache, when i put on the option friendlys urls, i also create a new .htacess, but 50% of the produtcs dont show up the photos, and even when i click in one product without photo, it shows "product unavaible", this is strange, maybe i have to regerate all the photos? I beeing desperate with this, can you help me? Thanks a lot
Link to comment
Share on other sites

Can you check whether the images actually exist? Look in your img/p directory for a file with the ID of product that isn't displaying its images. If the images are there, it must be a URL rewrite issue. If there is only one image with that product ID are there are no thumbnail images, then you'll need to regenerate your thumbnails. If there aren't any images at all that start with the product ID, then you'll need to edit the product, delete the missing images and then reupload them.

Link to comment
Share on other sites

  • 4 weeks later...
  • 4 weeks later...

No, you only have to generate the .htaccess file once. The product name is copied into the friendly URL field as you type it. You can manually edit the friendly URL yourself and change it so that it is different for each language.

Link to comment
Share on other sites

  • 2 months later...
Your .htaccess file looks fine. Perhaps it is a server configuration issue. Do you use Apache or IIS? The .htaccess file that PrestaShop generates only works with Apache.

I have the same problem and I use IIS7. .htaccess is the same as shown here before. All links are broken, what shall I do ?
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...