Jump to content

Images not working with friendly URLs


Yoosuf

Recommended Posts

Initially when I enabled the friendly URLs, none of the links worked in my store.
However after some rigorous research and regenerating the .htaccess files the links are working correctly now

 

However the images are not displayed in the front office of my store

The images are shown only in the backoffice

I have also regenerated the thumbnails

 

 

My store is presently in maintenance mode, therefore please let me know your IP address so that I could add it.

 

post-530880-0-71384600-1378970231_thumb.jpg

post-530880-0-23401600-1378970282_thumb.jpg

hta.txt

Link to comment
Share on other sites

Initially when I enabled the friendly URLs, none of the links worked in my store.

However after some rigorous research and regenerating the .htaccess files the links are working correctly now

 

However the images are not displayed in the front office of my store

The images are shown only in the backoffice

I have also regenerated the thumbnails

 

 

My store is presently in maintenance mode, therefore please let me know your IP address so that I could add it.

 

hello

you attached screenshot with "top" section, there is no image - you've got right (weridy question marks)

but ... product pictures works well? categories too?

 

i just wondering, you see this question mark for each page in your store? or only for certain pages?

Link to comment
Share on other sites

so you've got some issue with CSS, youv'e got this path defined in global.css file, take a look:

#main-wrap {
background: url(../imag/tail-main.gif) left top repeat-x #F8C932 /* 1d1a16 */;
width: 100%;
padding: 0;
overflow: hidden;
}

backgrund: url(../imag/tail-main.gif)

 

you have to change /imag/ to /img/ there

Link to comment
Share on other sites

so you've got some issue with CSS, youv'e got this path defined in global.css file, take a look:

#main-wrap {
background: url(../imag/tail-main.gif) left top repeat-x #F8C932 /* 1d1a16 */;
width: 100%;
padding: 0;
overflow: hidden;
}

backgrund: url(../imag/tail-main.gif)

 

you have to change /imag/ to /img/ there

I changed it to img, but now the background became black!

Link to comment
Share on other sites

it will be painfull work because you have to do this... for all CSS files and all /imag/ instances ;/

Ok thanks I shall see to it

But I think that folder imag, was created through some code error because it wasnt there to begin with

Anyhow I shall revert to you once I check each of the files

Link to comment
Share on other sites

I fixed the issue, however if you go to the console in Chrome inspect element, it displays a list of CSS files as 404 not found

In fact, all of these files are available in the exact directory, although they may be blank

 

Any ideas on how this could be sorted out

Link to comment
Share on other sites

i have the same problem 3 days ago, i find a solution, you must generate a .htaccess file from backoffice after you put friendly url !! be aware, if you have apache server, you must activate from apache conf. file, utilization of htaccess !! the problem with image is because they load`s from some path (exemple yourdomain.com/img/picture-medium-9.jpg) and now, the user friendly alterate this path !! this staf generate prestashop when i generate htaccess file (i have an old version of presta 1.3)

# 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]+)\-([0-9]+)/([_a-zA-Z0-9-]*)\.jpg$ /img/p/$1-$2.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 ^lang-([a-z]{2})/([0-9]+)\-([a-zA-Z0-9-]*)\.html(.*)$ /product.php?id_product=$2&isolang=$1$4 [L,E]
RewriteRule ^lang-([a-z]{2})/([0-9]+)\-([a-zA-Z0-9-]*)(.*)$ /category.php?id_category=$2&isolang=$1 [QSA,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]
Edited by Hans Fritz (see edit history)
Link to comment
Share on other sites

 

i have the same problem 3 days ago, i find a solution, you must generate a .htaccess file from backoffice after you put friendly url !! be aware, if you have apache server, you must activate from apache conf. file, utilization of htaccess !! the problem with image is because they load`s from some path (exemple yourdomain.com/img/picture-medium-9.jpg) and now, the user friendly alterate this path !! this staf generate prestashop when i generate htaccess file (i have an old version of presta 1.3)

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

Hi Hans,

I also met this error, product image disappear when i turn-on Friendly.

Some week ago, my website was still oK with enabled friendly then the Quick Search Block has issue, this returns nothing for all search. I have changed the search.php in /classes folder as some topic and the quick search could run but frm that the image of product disappeared.

I have re-generate htaccess, reindex in search tab (in Preference) but it did not help.

Turn-off the Friendly rewrite, all products are showed normally.

 

I also think about htacess but I am poor abut this.

 

- What should we do?

- How to check and activate from apache conf. file

- Im using Prestashop 1.4.4.1

 

please let me your advice.

 

Khang

Hans Fritz

Edited by vitelvn83 (see edit history)
Link to comment
Share on other sites

The problem was actually in my theme as the image name types defined in the prestashop back office were different to those used in my theme. For example, the back office had an image type called, medium_default, whereas my theme used a name called large

So I had to manually check each of the theme files and some modules in order to fix the error.

Link to comment
Share on other sites

  • 1 year later...

Happened to me many times, answer is simple.

URL rewriting (mod_rewrite) is not active on your server,

 

But you can do it simply by deleting your existing .htaccess file (but backup it first), go to SEO and URLs and make make accented urls enabled and it's done!

 

It works for me every time on iPower, GoDaddy, Hostmonster, Bluehost and other hostings as well.

  • Like 1
Link to comment
Share on other sites

  • 4 months later...

Peter your issue is different.

 

Question mark images are displayed because there is no image in that path.

And code causing that is 

<!-- MODULE Block contact infos -->

<style type="text/css">
.footer-container {
    background: url('../img/footer-bg.png') repeat-x scroll 0% 0% #333;
}

......

Not sure why and were is that included maybe some tpl file, but similar code exists in global.css.

Link to comment
Share on other sites

  • 1 month later...
  • 4 years later...
On 9/30/2014 at 7:33 PM, Junaid Khawaja said:

Happened to me many times, answer is simple.

URL rewriting (mod_rewrite) is not active on your server,

 

But you can do it simply by deleting your existing .htaccess file (but backup it first), go to SEO and URLs and make make accented urls enabled and it's done!

 

It works for me every time on iPower, GoDaddy, Hostmonster, Bluehost and other hostings as well.

Junaid nailed it! 

I have been working on this for 10 hours. Spent 30 seconds doing what he suggested and it fixed the issue!!! save htaccess. , delete it. then turn on accented and seo in admin panel. It generated a good htaccess. and everything is working. 

 

Thank you!!!

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