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

Wim Leers’s picture

Assigned: Unassigned » Wim Leers

Interesting! I'll add this to the CDN unit tests.

hoZt’s picture

I am also seeing the same issue, but only when I have a link on a media image file. I am using the pull method.

mrcliff’s picture

Similar 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!

andb’s picture

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

Wim Leers’s picture

Title: wrong domain when prefix www not used » Image links to site are rewritten wrong domain when prefix www not used
Priority: Major » Normal
Status: Active » Postponed (maintainer needs more info)

This 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?

Wim Leers’s picture

Title: Image links to site are rewritten wrong domain when prefix www not used » Images linking to site are rewritten to link to the CDN (but only when using the no-www domain)
Wim Leers’s picture

Status: Postponed (maintainer needs more info) » Closed (duplicate)

Over 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 :)

Wim Leers’s picture

Issue summary: View changes

Modified a url that was leading to a blocked area on my site