Jump to content
Yoosuf

Images not working with friendly URLs

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

Share this post


Link to post
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?

Share this post


Link to post
Share on other sites

Yes for each page, category product image as well as the header and footer the question mark is shown

minimart.lk

Edited by Yoosuf (see edit history)

Share this post


Link to post
Share on other sites

 

minimart.lk

this is your store url ? i can't find there "shop" section etc.

Share this post


Link to post
Share on other sites

this is your store url ? i can't find there "shop" section etc.

I enabled the shop

Please refresh the page

Share this post


Link to post
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

Share this post


Link to post
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!

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

you can always duplicate img directory and change it's name to /imag/ :)

  • Like 1

Share this post


Link to post
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

Share this post


Link to post
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)

Share this post


Link to post
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)

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

Hello,

I have similair on my website:

 

 

www.weatherdefender.co.uk

 

 

Please have a look and wondered if there is a fix. See attached

 

 

 

Regards

Peter

post-891633-0-50081100-1422896001_thumb.jpg

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

Same problem. When i extracted images to another website from a custom feed products images not appear because the img rewriting. And go on front page and categories 1 error /none not found 404. and other non sense error. 

And if i delete htaccess no images appear anymore. 

http://sensuals.ro

Share this post


Link to post
Share on other sites
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!!!

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More