: Avoid 301 redirect in cdn.domain.mx I have a domain with a .htaccess redirection problem. The active CDN the URL should be: cdn.domain.mx/images/test.png but redirects: cdn.domain.mx/images/something.png
I have a domain with a .htaccess redirection problem. The active CDN the URL should be: cdn.domain.mx/images/test.png but redirects:
cdn.domain.mx/images/something.png -> domain.mx/images/something.png
This causes my web resources not to be served from the CDN. Here is the code in the .htaccess:
RewriteEngine on
RewriteCond %{HTTPS} on
RewriteRule (.*) %{HTTP_HOST}%{REQUEST_URI} [R=301,L]
RewriteCond %{HTTP_HOST} ^domain.com$ [OR,NC]
RewriteCond %{HTTP_HOST} ^www.domain.com$ [OR,NC]
RewriteCond %{HTTP_HOST} ^domain.example.com$ [OR,NC]
RewriteCond %{HTTP_HOST} ^www.domain.example.com$ [OR,NC]
RewriteCond %{HTTP_HOST} ^domain.mx$ [NC]
RewriteRule ^(.*)$ www.domain.mx/ [R=301,L]
I have also configured the CNAME on my domain:
cdn.domain.mx. CNAME domain.company.netdna-cdn.com
Details:
A resource site is:
depilacionconlaser.mx/images/contenidos/inicio/productos-principales/depilacion-laserhome.jpg
The URL of the resource with CDN is:
cdn.depilacionconlaser.mx/images/contenidos/inicio/productos-principales/depilacion-laserhome.jpg
If I enter the URL of the resource with CDN in my browser, I'm redirected to Redirection not indicated in the HTACCESS.
More posts by @Sims2060225
1 Comments
Sorted by latest first Latest Oldest Best
CDN servers are configured to serve the resource if they already have a copy. If they don't have a copy, they need to fetch it from your website. To do so, they need to know what the address of your server is. You would have told them this information during the setup process for the CDN.
It seems likely to me that the CDN is set up to fetch content from domain.mx, domain.com or one of the other domains that you are redirecting. In that case, the CDN would serve redirects for those resources.
The solution would be to reconfigure your CDN to fetch content from domain.mx when it doesn't have a copy of the content. Log into your CDN account to make this setting change.
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.