Jump to content

Media server with self hosted CDN no images showed up


DARKF3D3

Recommended Posts

Hi,
I created a self hosted cdn configuring a subdomain that point to the same folder as the prestashop installation of the main domain.
From PS b.o. "Media servers" page (Advanced paramenters >> Performance) I wrote the subdoman url.
Now css and js files are served correctly by the self hosted cdn, but the images are not showed up.
The url of the images seem to be correct, but result in 404 error.

Any idea on why this happens?

 

Link to comment
Share on other sites

In the administration panel Preferences - Traffic disable Friendly URL and Save, delete the .htaccess file via FTP on the server and then re-enable Friendly URL in the admin panel + save and delete the store's temporary files, reload the browser with the Ctrl+Shift+R button

Link to comment
Share on other sites

Thanks@przemex, your suggestion pointed me into the right direction to fix the issue.

Into htaccess file I had these rules for www redirect that interfered also with the subdomain. Once removed images showed up correctly

RewriteEngine On
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule ^(.*)$ https://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

 

Link to comment
Share on other sites

That's why I wrote about it, if a new .httacess file was generated it would automatically be corrected and not everyone can edit code, my method is easy and simple, anyway it's great that the problem was finally solved.

Link to comment
Share on other sites

Yes, your solution would certainly have been quicker, but unfortunately I cannot deactivate friendly urls on my site because In past I customized some urls using a module, which I tehn removed.
So if I deactivate friendly url, then I wont be able to activate them again, because some settings are not accepted by PS.

 

Link to comment
Share on other sites

15 hours ago, DARKF3D3 said:

So if I deactivate friendly url, then I wont be able to activate them again, because some settings are not accepted by PS.

if you don't mind me asking, its obvious for me that one shop is not ideal. Why not opening other shops where you have not to doctore around that much?

You can test different approaches. And its not that expensive, below 100 US you get a domain plus VPS, or shared host.

Link to comment
Share on other sites

Hi,

If I understand correctly, you've created a sub-domain on the same hosting server, pointing to exactly the same place as the store's main domain name.

Since the advent of the HTTP/2 protocol, there's no point in doing this, and it won't improve performance or referencing.

You need to use a real CDN to benefit from several advantages, such as distribution closer to customers, resource-saving on the main server and options like image reprocessing, for example.

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