Jump to content

Images not displaying using friendly-URLs ?


Recommended Posts

Hi Chris,
Yes I have, it's seems to be a problem with the path that points to the product images.
It creates the friendly-url ok but it's just that I then can't see the actual thumbnail images.
When I turn off 'friendly-urls' they display fine again.
It's very frustrating but thanks for your reply.
regards,
ChurchPath.

Link to comment
Share on other sites

Have a look at your .htaccess file, your image rewrites should have the correct slashes / and \

RewriteRule ^([0-9]+)\-([0-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]

as long as your site is not in subfolder, if in subfolder then you will need that name too
good luck
John

Link to comment
Share on other sites

Dear all,

I'm also using version 1.2.0.5 and my product images are not displaying. I have looked in my img/p directory and all the thumbnails are there, as expected. I've added Snol's lines to my .htaccess and restarted Apache, cleared my cache, cleared cookies and still no porducte images. I am running a development install of PS on my localhost on a Windows OS and my PS install is in my server's root dir. I wonder, ChurchPath, if you've resolved this for your install and if so if you could please post your solution?

Best,
Meg

Link to comment
Share on other sites

My .htaccess:
# URL rewriting module activation
RewriteEngine on

# URL rewriting rules
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 ^([0-9]+)\-([0-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]

# Catch 404 errors
ErrorDocument 404 /404.php

My PrestaShop install directory:
C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\prestashop

And img dir:
C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\prestashop\img

I can confirm that LoadModule rewrite_module modules/mod_rewrite.so is uncommented in my httpd.conf

This has to be something blindly obvious that I'm just not seeing - be kind won't you? :D

Meg

Link to comment
Share on other sites

did you get prestashop to automatically generate the .htaccess file Meg, preferences/friendly URLs/click generate a .htaccess file and use that.

also for reference my .htaccess is this as below

# .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
AddType x-mapp-php5 .php
# URL rewriting rules
RewriteRule ^([0-9]+)\-([0-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 ^([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]
# Catch 404 errors
ErrorDocument 404 /404.php

remeber backup..backup..backup any files you are going to change.

Link to comment
Share on other sites

They are in fact comments using hash marks.

Right, thanks for your help!

Meg


yes the bullet thing happens both ways.

try each .htaccess when you move to live server you may need to add / on each line dependaent on if you will be in subfolder or not
Link to comment
Share on other sites

Oh goodness. I knew it was something ridiculously obvious. I didn't realise there was a link to generate the file. I thought I had to 'generate' the file with my own entries. Indeed, the .htacess I've just generated through the CMS is working just fine. Gracious, how embarassing. Thanks for your help.

Oh, yes, I use SVN and live to 'revert' my cock ups ;)

Thanks again,
Meg

Link to comment
Share on other sites

  • 1 month later...
  • 7 months later...
did you get prestashop to automatically generate the .htaccess file Meg, preferences/friendly URLs/click generate a .htaccess file and use that.

also for reference my .htaccess is this as below

# .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
AddType x-mapp-php5 .php
# URL rewriting rules
RewriteRule ^([0-9]+)\-([0-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 ^([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]
# Catch 404 errors
ErrorDocument 404 /404.php

remeber backup..backup..backup any files you are going to change.



Can you please help me?
I have this htacess:

# .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

But somehow some pictures tha majority did not show, thanks in advance
Link to comment
Share on other sites

×
×
  • Create New...