Jump to content
banan_44

[Prestashop 1.7] No images when Firendly URL is active

Recommended Posts

Hi. I am new to Prestashop. I've just installed a clean version to test how Presta works. After installation I have notice that all sample product images are not shown. I have read that I might have a problem with friendly url. So I visited the back office and turned off  friendly urls and the product images are shown. But when I turn the urls on again the images disappear again. When I try open these images in new tab I have 404 Error. 

I have removed .htaccess file from the main directory and regenerated it by turning on Friendly URL but it did not help. It's hard to have a shop without images. Can anyone help me with that problem? 

 

EDIT

Problem solved. It was a server problem.

Edited by banan_44
Problem solved (see edit history)

Share this post


Link to post
Share on other sites

Hello,

can you please help me? I have the same problem - what was the server problem?

I only get always "client denied by server configuration" and this say nothing to me.

Also Google Search doesn't help so far...

 

Greetings

AKW

 

Share this post


Link to post
Share on other sites

Hello, 

 

I had the same error. 

The problem was solved by editing the ssl domain. 

My cofiguration was main domain: natureldeluxe.be

ssl domain: www.natureldeluxe.be

-----> I did change the ssl domain to natureldeluxe.be & the problem was fixed. 

Share this post


Link to post
Share on other sites

Alternatively, one should check if the server has mod_rewrite active.

Share this post


Link to post
Share on other sites

I have the very same issue!

After a fresh install of 1.7.4.4 all sample product images are not shown, Create a new product and also did not display the product photo.
If I switch and turned off friendly urls then the product images are shown also the new one I just added, but when I turn the friendly urls on again the images disappear again.

The links works good, I really want to use the friendly url for better SEO but I cannot make it works as expected.

Here is the store:  shop.finedresser.com  I let the Friendly URL on so you can see the bad behavior.

First photo is Friendly URL = YES
Second photo is Friendly URL = NO

 

Screen_Shot_2018-12-11_at_6_44.43_AM.png

Screen_Shot_2018-12-11_at_6_45.33_AM.png

Share this post


Link to post
Share on other sites

My issue was that the server was an Nginx, so the rewritable rules does not make sense on the .htaccess you need to add the rules on the .conf files for de nginx server.

Share this post


Link to post
Share on other sites
Just now, Dsousa said:

My issue was that the server was an Nginx, so the rewritable rules does not make sense on the .htaccess you need to add the rules on the .conf files for de nginx server.

Or the super easy way, change to a regular apache server. 

Share this post


Link to post
Share on other sites

Hello,

Did somebody find another solution here?

I have the same problem now in Prestashop 1.7.5.1. I did the following things, but still not working:

1. I disabled the Friendly URL -> the images are showing -> enabled back the Friendly URL -> the images NOT showing.

2. Put the following .htaccess in the folder "img":

<IfModule mod_php5.c>
    php_flag engine off
</IfModule>

# Apache 2.2
<IfModule !mod_authz_core.c>
    Order deny,allow
    Deny from all
    <Files ~ "(?i)^.*\.(jpg|jpeg|gif|png|bmp|tiff|svg|pdf|mov|mpeg|mp4|avi|mpg|wma|flv|webm|ico)$">
        Allow from all
    </Files>
</IfModule>

# Apache 2.4
<IfModule mod_authz_core.c>
    Require all denied
    <Files ~ "(?i)^.*\.(jpg|jpeg|gif|png|bmp|tiff|svg|pdf|mov|mpeg|mp4|avi|mpg|wma|flv|webm|ico)$">
        Require all granted
    </Files>
</IfModule>

 

Thank you,

Share this post


Link to post
Share on other sites

Hi all,

I think the problem is solved for me. It worked after i removed the .htaccess from the root and then activate the "Friendry URL" (or let it activated if is already so) and Save.

Tks,

  • Like 1

Share this post


Link to post
Share on other sites

i got the same issue, removed the .htaccess doesn't help.

anyone has other idea how to make it works.

Thank you.

Share this post


Link to post
Share on other sites
On 4/6/2019 at 11:02 AM, bzero said:

i got the same issue, removed the .htaccess doesn't help.

anyone has other idea how to make it works.

Thank you.

If you are in a Nginx server the .htaccess is not going to work

Share this post


Link to post
Share on other sites

hey am also facing same problem its my .conf file any one help me to fix....

 

Quote

proxy_cache_path /var/nginx/cache/smithikakart levels=1 keys_zone=smithikakart:128m inactive=1h;

limit_req_zone $binary_remote_addr zone=smithikakart_smithikakart_in:1m rate=15r/m;

server {

    listen xxxxxxxxx:80 ;

    server_name smithikakart.in www.smithikakart.in mail.smithikakart.in;


    root /home/smithikakart/public_html;

    gzip on;
    etag on;
    gzip_proxied any;
    gzip_comp_level 3;
    gzip_buffers 16 8k;
    gzip_http_version 1.1;
    gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript application/javascript;
    gzip_vary on;

    brotli_static on;
    brotli on;
    brotli_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript application/javascript;
    brotli_comp_level 4;

    proxy_bind xxxxxxxxxxxxx;

    proxy_cache smithikakart;
    proxy_ignore_headers Cache-Control Expires ;
    proxy_cache_valid 200 14400s;
    proxy_cache_valid 406 0s;
    proxy_cache_valid 404 10s;
    proxy_cache_valid 500 0;
    proxy_cache_use_stale updating error timeout http_502 http_503 http_504;
    proxy_cache_lock on;
    proxy_cache_key "$scheme$request_method$host$request_uri";
    proxy_cache_convert_head on;

    include errors.conf;


    rewrite ^/cpanel/?$ https://$hostname:2083/ permanent;
    rewrite ^/whm/?$ https://$hostname:2087/ permanent;
    rewrite ^/webmail/?$ https://$hostname:2096/ permanent;


    tcp_nodelay off;

    if ($request_uri ~ "^(.*/wp-admin|.*/administrator|/admin|/user|.*/wp-cron\.php|/.*login\.php|/opcache\.php|.*/xmlrpc\.php|.*/phpinfo\.php|/basket.*|/cart.*|/my-account.*|/checkout.*|/addons.*)") {
        set $cache_bypass 1;
    }


    location ~* \.(ico|jpe?g|gif|png|bmp|svg|tiff|exe|dmg|zip|rar|7z|docx?|xlsx?|js|css|less|sass|scss|ttf|woff2?|mp3|mp4|mkv|avi|mov|mpe?g|aac|wav|flac)$ {
        expires 7d;
        add_header Cache-Control "public, must-revalidate";
        add_header X-Proxy-Cache "STATIC/TYPE";
    }

    location ~ "^(/wp-content/uploads)" {
        expires 7d;
        add_header Cache-Control "public, must-revalidate";
        add_header X-Proxy-Cache "STATIC/PATH";
    }

    if ($http_cookie ~ "(_logged_in_|items_in_cart|jsid)") {
        set $cache_bypass 1;
    }

    location ~ "^(/.*login\.php|.*/xmlrpc\.php|.*/wp-cron\.php)" {
        limit_req_status 429;
        limit_req zone=smithikakart_smithikakart_in burst=8 nodelay;

        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header Host $http_host;
        proxy_set_header X-Forwarded-Proto $scheme;

        proxy_no_cache 1;
        proxy_cache_bypass 1;
        add_header X-Proxy-Cache $upstream_cache_status;


        proxy_pass http://xxxxxxx:8080;
    }


    location / {
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header Host $http_host;
        proxy_set_header X-Forwarded-Proto $scheme;

        proxy_no_cache $cache_bypass;
        proxy_cache_bypass $cache_bypass;
        add_header X-Proxy-Cache $upstream_cache_status;


        proxy_pass http://xxxxxxxxxxx:8080;
    }

    location ~ ^/purge(/.*) {
        proxy_cache_purge smithikakart "$scheme$request_method$host$1";
    }
}

server {

    listen xxxxxxxx:80;

    server_name cpanel.smithikakart.in;


    location ~ "^/(\.well-known\/|[A-Fa-f0-9]{32}.txt$)" {
        root /home/smithikakart/public_html;
    }

    location / {
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header Host $http_host;
        proxy_set_header X-Forwarded-Proto $scheme;

        proxy_bind xxxxxxxxx;

        proxy_pass http://xxxxxxxxxxxx/;
    }
}

server {

    listen xxxxxxxxxxxxxx;

    server_name webmail.smithikakart.in;


    location ~ "^/(\.well-known\/|[A-Fa-f0-9]{32}.txt$)" {
        root /home/smithikakart/public_html;
    }

    location / {
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header Host $http_host;
        proxy_set_header X-Forwarded-Proto $scheme;

        proxy_bind xxxxxxxxxxxx;

        proxy_pass http://xxxxxxxxxx:8080/;
    }
}
 server {

    listen xxxxxxxxxxxx:80;

    server_name whm.smithikakart.in;


    location ~ "^/(\.well-known\/|[A-Fa-f0-9]{32}.txt$)" {
        root /home/smithikakart/public_html;
    }

    location / {
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header Host $http_host;
        proxy_set_header X-Forwarded-Proto $scheme;

        proxy_bind xxxxxxxxxxxx;

        proxy_pass http://xxxxxxxxxxx:2086/;
    }
}

server {

    listen xxxxxxx:80;

    server_name webdisk.smithikakart.in;


    location ~ "^/(\.well-known\/|[A-Fa-f0-9]{32}.txt$)" {
        root /home/smithikakart/public_html;
    }

    location / {
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header Host $http_host;
        proxy_set_header X-Forwarded-Proto $scheme;

        proxy_bind xxxxxxxxx;

        proxy_pass xxxxxxxxxxxx/;
    }
}


server {

    listen xxxxxxxxxx:443 ssl http2 ;

    server_name smithikakart.in www.smithikakart.in mail.smithikakart.in;

    ssl_certificate /var/nginx/certs/smithikakart-in.pem;
    ssl_certificate_key /var/nginx/certs/smithikakart-in.key;


    root /home/smithikakart/public_html;

    gzip on;
    etag on;
    gzip_proxied any;
    gzip_comp_level 3;
    gzip_buffers 16 8k;
    gzip_http_version 1.1;
    gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript application/javascript;
    gzip_vary on;

    brotli_static on;
    brotli on;
    brotli_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript application/javascript;
    brotli_comp_level 4;

    proxy_bind xxxxxxxxxxx;

    proxy_cache smithikakart;
    proxy_ignore_headers Cache-Control Expires ;
    proxy_cache_valid 200 14400s;
    proxy_cache_valid 406 0s;
    proxy_cache_valid 404 10s;
    proxy_cache_valid 500 0;
    proxy_cache_use_stale updating error timeout http_502 http_503 http_504;
    proxy_cache_lock on;
    proxy_cache_key "$scheme$request_method$host$request_uri";
    proxy_cache_convert_head on;

    include errors.conf;


    rewrite ^/cpanel/?$ https://$hostname:2083/ permanent;
    rewrite ^/whm/?$ https://$hostname:2087/ permanent;
    rewrite ^/webmail/?$ https://$hostname:2096/ permanent;


    tcp_nodelay off;

    if ($request_uri ~ "^(.*/wp-admin|.*/administrator|/admin|/user|.*/wp-cron\.php|/.*login\.php|/opcache\.php|.*/xmlrpc\.php|.*/phpinfo\.php|/basket.*|/cart.*|/my-account.*|/checkout.*|/addons.*)") {
        set $cache_bypass 1;
    }


    location ~* \.(ico|jpe?g|gif|png|bmp|svg|tiff|exe|dmg|zip|rar|7z|docx?|xlsx?|js|css|less|sass|scss|ttf|woff2?|mp3|mp4|mkv|avi|mov|mpe?g|aac|wav|flac)$ {
        expires 7d;
        add_header Cache-Control "public, must-revalidate";
        add_header X-Proxy-Cache "STATIC/TYPE";
    }

    location ~ "^(/wp-content/uploads)" {
        expires 7d;
        add_header Cache-Control "public, must-revalidate";
        add_header X-Proxy-Cache "STATIC/PATH";
    }

    if ($http_cookie ~ "(_logged_in_|items_in_cart|jsid)") {
        set $cache_bypass 1;
    }

    location ~ "^(/.*login\.php|.*/xmlrpc\.php|.*/wp-cron\.php)" {
        limit_req_status 429;
        limit_req zone=smithikakart_smithikakart_in burst=8 nodelay;

        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header Host $http_host;
        proxy_set_header X-Forwarded-Proto $scheme;

        proxy_no_cache 1;
        proxy_cache_bypass 1;
        add_header X-Proxy-Cache $upstream_cache_status;


        proxy_ssl_verify off;
        proxy_ssl_session_reuse off;
        proxy_ssl_name $http_host;
        proxy_ssl_server_name on;
        proxy_pass https://xxxxxxxxxxx:8443;
    }


    location / {
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header Host $http_host;
        proxy_set_header X-Forwarded-Proto $scheme;

        proxy_no_cache $cache_bypass;
        proxy_cache_bypass $cache_bypass;
        add_header X-Proxy-Cache $upstream_cache_status;


        proxy_ssl_verify off;
        proxy_ssl_session_reuse off;
        proxy_ssl_name $http_host;
        proxy_ssl_server_name on;
        proxy_pass https://xxxxxxxxxxxx;
    }

    location ~ ^/purge(/.*) {
        proxy_cache_purge smithikakart "$scheme$request_method$host$1";
    }
}

server {

    listen xxxxxxxxxx:443 ssl http2;

    server_name cpanel.smithikakart.in;

    ssl_certificate /var/nginx/certs/smithikakart-in.pem;
    ssl_certificate_key /var/nginx/certs/smithikakart-in.key;

    ssl_prefer_server_ciphers on;
    ssl_buffer_size 8k;

    ssl_protocols  TLSv1.1 TLSv1.2 TLSv1.3;
    ssl_ciphers 'EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256';
    ssl_ecdh_curve secp384r1;
    ssl_dhparam /var/nginx/dhparams.pem;

    http2_idle_timeout 5m;

    location ~ "^/(\.well-known\/|[A-Fa-f0-9]{32}.txt$)" {
        root /home/smithikakart/public_html;
    }

    location / {
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header Host $http_host;
        proxy_set_header X-Forwarded-Proto $scheme;

        proxy_bind xxxxxx;

        proxy_ssl_verify off;
        proxy_ssl_session_reuse off;
        proxy_ssl_name $http_host;
        proxy_ssl_server_name on;
        proxy_set_header X-HTTPS 1;
        proxy_pass http://xxxxxxxxxxx:2082/;
    }
}

server {

    listen xxxxxxxxxxxx:443 ssl http2;

    server_name webmail.smithikakart.in;

    ssl_certificate /var/nginx/certs/smithikakart-in.pem;
    ssl_certificate_key /var/nginx/certs/smithikakart-in.key;

    ssl_prefer_server_ciphers on;
    ssl_buffer_size 8k;

    ssl_protocols  TLSv1.1 TLSv1.2 TLSv1.3;
    ssl_ciphers 'EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256';
    ssl_ecdh_curve secp384r1;
    ssl_dhparam /var/nginx/dhparams.pem;

    http2_idle_timeout 5m;

    location ~ "^/(\.well-known\/|[A-Fa-f0-9]{32}.txt$)" {
        root /home/smithikakart/public_html;
    }

    location / {
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header Host $http_host;
        proxy_set_header X-Forwarded-Proto $scheme;

        proxy_bind xxxxxxxxxxxxxx;

        proxy_ssl_verify off;
        proxy_ssl_session_reuse off;
        proxy_ssl_name $http_host;
        proxy_ssl_server_name on;
        proxy_set_header X-HTTPS 1;
        proxy_pass http://xxxxxxxxxxxx:8080/;
    }
}
 server {

    listen xxxxxxxxx:443 ssl http2;

    server_name whm.smithikakart.in;

    ssl_certificate /var/nginx/certs/smithikakart-in.pem;
    ssl_certificate_key /var/nginx/certs/smithikakart-in.key;

    ssl_prefer_server_ciphers on;
    ssl_buffer_size 8k;

    ssl_protocols  TLSv1.1 TLSv1.2 TLSv1.3;
    ssl_ciphers 'EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256';
    ssl_ecdh_curve secp384r1;
    ssl_dhparam /var/nginx/dhparams.pem;

    http2_idle_timeout 5m;

    location ~ "^/(\.well-known\/|[A-Fa-f0-9]{32}.txt$)" {
        root /home/smithikakart/public_html;
    }

    location / {
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header Host $http_host;
        proxy_set_header X-Forwarded-Proto $scheme;

        proxy_bind xxxxxxxxxx;

        proxy_ssl_verify off;
        proxy_ssl_session_reuse off;
        proxy_ssl_name $http_host;
        proxy_ssl_server_name on;
        proxy_set_header X-HTTPS 1;
        proxy_pass http://xxxxxxxxxxx:2086/;
    }
}

server {

    listen xxxxxxxxxxxxx:443 ssl http2;

    server_name webdisk.smithikakart.in;

    ssl_certificate /var/nginx/certs/smithikakart-in.pem;
    ssl_certificate_key /var/nginx/certs/smithikakart-in.key;

    ssl_prefer_server_ciphers on;
    ssl_buffer_size 8k;

    ssl_protocols  TLSv1.1 TLSv1.2 TLSv1.3;
    ssl_ciphers 'EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256';
    ssl_ecdh_curve secp384r1;
    ssl_dhparam /var/nginx/dhparams.pem;

    http2_idle_timeout 5m;

    location ~ "^/(\.well-known\/|[A-Fa-f0-9]{32}.txt$)" {
        root /home/smithikakart/public_html;
    }

    location / {
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header Host $http_host;
        proxy_set_header X-Forwarded-Proto $scheme;

        proxy_bind xxxxxxxxxxxxx;

        proxy_ssl_verify off;
        proxy_ssl_session_reuse off;
        proxy_ssl_name $http_host;
        proxy_ssl_server_name on;
        proxy_set_header X-HTTPS 1;
        proxy_pass http://xxxxxxxxxxxx:2077/;
    }
}
 

 

Edited by Smithikamobiles (see edit history)

Share this post


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

Important Information

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