Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Hello,
There is a peculiar issue with my site and CDN module.
I prefer urls without "www" prefix. But any image linked to my domain gets the cdn prefix of a CNAME "cdn.dinajpur.net". But if I use www in the links, it wont happen.
For example I'm showing a banner/logo in a block linking my site http://dinajpur.net. But the link appears as http://cdn.dinajpur.net. But if I'm linking as http://www.dinajpur.net, the links are ok.
Could somebody pls help me?
Comments
Comment #1
Wim LeersInteresting! I'll add this to the CDN unit tests.
Comment #2
hoZt CreditAttribution: hoZt commentedI am also seeing the same issue, but only when I have a link on a media image file. I am using the pull method.
Comment #3
mrcliff CreditAttribution: mrcliff commentedSimilar issue on a site I maintain. There are a handful of images with relative links such as "/services". When I enable the CDN module, the CDN mapping is added to these links, ie "http://X.cloudfront.net/services".
Beyond that, a really great module, thanks!
Comment #4
andb CreditAttribution: andb commentedI'm experiencing this same problem, the issue being that I have DEV and STAGE envs which are dev.example.com and stage.example.com.
I have a view which lists a a set of nodes, the format is "Fields". One of the fields is an imagefield with "Link image to:" set to "Content". That anchor around the
<img>
tag is also being rewritten.I haven't taken a look at the code yet. I'm curious as to why it would work properly with a www prefix. One of the potential solutions for me could be limiting the rewrite to CDN to paths in /sites/*. I'll try to find some time to see if I can solve this.
Comment #5
Wim LeersThis is a problem rooted in
cdn_html_alter_image_urls()
.However… I'm pretty sure this was actually already resolved in #1623252: Only rewrite image links when they have the same file extension as the image's!
Can you please install the -dev version temporarily (I'm prepping it for the upcoming 2.6 bugfix release, so it's more stable than the 2.5 release already), to check whether that fixes the problem?
Comment #6
Wim LeersComment #7
Wim LeersOver at #1929918: Test coverage for image URL rewriting, I added test coverage for this. This way, we can guarantee this is actually solved. Tests are passing, hence it is solved. Yay :)
Comment #7.0
Wim LeersModified a url that was leading to a blocked area on my site