Jump to content

Missing frontpage images after generating htaccess and friendly URL ON


Recommended Posts

After turning on SEO friendly URL in admin and generating .htaccess file inside a blank htaccess file

Now it look like this:

# .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$ /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 ^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]

# Catch 404 errors
ErrorDocument 404 /404.php



my category and product images are missing and instead of images a question mark image 404 is displayed. But Some of my product images, I guess like 4 or 6 from approximately 25m, are shown.

Anyway no category image is shown :(
Strange thing is that I see the images in backend ok, when trying to edit e.g. the category or subcategory image the image is there, but in frontend the images are missing.

How to solve this strange problem?

Thanks in advance.

Link to comment
Share on other sites

OK, now after increasing ram using php.ini I am able to regenerate images and product images are showing OK.

However, I have regenerated the category images but they are not showing at all }in backend I see them OK).

Any advice how can I display the category images too?

Thanks in advance.

Link to comment
Share on other sites

OK, so the products are now working however the category images are not :(. In backend they are OK, in frontend the are not.

I assume that this line from .htaccess is wrong:

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

I attached a screenshot of what I mean by missing image in category view.

I have tried to regenerate all the images many times in backen, but without any chagne :(

Any advice what should I try next?

Thanks.

42301_hHYx0oGWxqT4pJENqpc0_t

Link to comment
Share on other sites

Try disabling friendly URLs. If the images appear, then there's something wrong with the .htaccess file. If the images are still missing, then the thumbnails are missing for the image.


yes, when I turn off the friendly url in admin the images areshown.

However, I need the friendly URL and redirects in htaccess, so I guess this line is the problematic one

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


the "c" in /img/c/ stands for category right?

Maybe the ruleset is wrong

Any advice?
Link to comment
Share on other sites

I don't think so. Here's the line in my .htaccess file:

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



I'm using PrestaShop v1.4. In v1.3, I have the following line:

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



I've had no problems with friendly URLs on my website.

Link to comment
Share on other sites

I have no idea. If the images are there and the .htaccess file is correct, it should work. I can't think of anything else that would prevent the images from displaying. It's worked for every website I've done.

Link to comment
Share on other sites

I had this problem too. I was missing some pictures, but not all.
My problem was not in .htaccess file. I installed Firebug in my Firefox and
I checked links from .tpl files.

There was wrong ftp path in custom template. It was like templates/img/etgirls/spacer.gif
and it sould be templates/img/et-girls/spacer.gif. Firefox managed to show pictures
right way with this wrong parth, but not with friendly URL's.

Link to comment
Share on other sites

I had this problem too. I was missing some pictures, but not all.
My problem was not in .htaccess file. I installed Firebug in my Firefox and
I checked links from .tpl files.

There was wrong ftp path in custom template. It was like templates/img/etgirls/spacer.gif
and it sould be templates/img/et-girls/spacer.gif. Firefox managed to show pictures
right way with this wrong parth, but not with friendly URL's.


Thanks, so how do you solve the problem in your case?
Link to comment
Share on other sites

I just corrected ftp path's in .tpl files. Meaning I took that "-" away from all links ( my file was header.tpl in tempaletes/etgilrs folder ).

Just check your .tpl files in your tempalate folder. Using firebug ( Firefox addon ) helps a lot.

If you have your ftp paths right in your .tpl files, then this in not helping you =(.

  • Like 1
Link to comment
Share on other sites

Hmm, I am not sure what do you mean with ftp path.

This is e.g. my catalog.tpl file.

{include file=$tpl_dir./breadcrumb.tpl} 
{include file=$tpl_dir./errors.tpl}



{if $category->id AND $category->active}
{strip}E-SHOP
        - {$category->name|escape:'htmlall':'UTF-8'}

           {if $nb_products == 0}{l s='There are no products.'}
           {else}
               {if $nb_products == 1}{l s='There is'}{else}{l s='There are'}{/if} 
               {$nb_products} 
               {if $nb_products == 1}{l s='product.'}{else}{l s='products.'}{/if}
           {/if}
{/strip}


   {if $scenes}
       <!-- Scenes -->
       {include file=$tpl_dir./scenes.tpl scenes=$scenes}
   {else}
       <!-- Category image -->
       {if $category->id_image}

getCatImageLink($category->link_rewrite, $category->id_image, 'category')}" alt="{$category->name|escape:'htmlall':'UTF-8'}" title="{$category->name|escape:'htmlall':'UTF-8'}" id="categoryImage" />

       {/if}
   {/if}

   {if $category->description}
{$category->description}
   {/if}
   {if isset($subcategories)}
   <!-- Subcategories -->

 {* {l s='Subcategories'} *}

       {foreach from=$subcategories item=subcategory}

getCategoryLink($subcategory.id_category, $subcategory.link_rewrite)|escape:'htmlall':'UTF-8'}" title="{$subcategory.name|escape:'htmlall':'UTF-8'}">
                   {if $subcategory.id_image}
getCatImageLink($subcategory.link_rewrite, $subcategory.id_image, 'category-two')}" alt="" />

                   {else}

                   {/if}




getCategoryLink($subcategory.id_category, $subcategory.link_rewrite)|escape:'htmlall':'UTF-8'}">{$subcategory.name|escape:'htmlall':'UTF-8'}

       {/foreach}




   {/if}

   {if $products}
           {include file=$tpl_dir./product-sort.tpl}
           {include file=$tpl_dir./product-list.tpl products=$products}
           {include file=$tpl_dir./pagination.tpl}
       {elseif !isset($subcategories)}

{l s='There are no products in this category.'}
       {/if}
{elseif $category->id}

{l s='This category is currently unavailable.'}
{/if}



What do you suggest to change?

Link to comment
Share on other sites

Ok. Now I see that your problem is different, my problem file was header.tpl. You may have to check with firebug, if
there is problem with other .tpl or .php file. May quess is that there is broken links somewhere.

But have you seen topic, I think that it also worth to check out:
http://www.prestashop.com/forums/viewthread/72230/development/solved_problem_with_enable_friendly_url

Link to comment
Share on other sites

  • 1 year later...

ok, i figured this out, what you need to do is go to your php.ini file and change

 

"memory_limit". to your maximum, 128M. worked for me...

 

so after you did that go back to your admin an go to Preferences>SEO&URLs, and then turn of your "Friendly URL", know go check you products or catagories and verify if all your images are showing...they should be showing, if they are , go back to Preferences>SEO&URLs and then turn on your "Friendly URL" know go check you products or catagories and verify if all your images are still showing...they should be showing, if so thing are good know,

 

 

and i will take that paypal donations of 10$ i need some lunch :rolleyes:

Link to comment
Share on other sites

×
×
  • Create New...