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.
Hi,
Can plaease somebody point me to correct setup if I want my files to be served from subdomain?
As I understood I should choose origin pull mode.
Then create a subdomain.
Copy all files inside same structure to new subdomain.
In config details of CDN module add new subdomain
Should I add some rules inside htaccess of new subdomain?
Thank you very much for help.
Comments
Comment #1
Wim LeersThe easiest way:
- make sure that your subdomains serve the exact same content as the main domain
- don't enable the CDN module's Far Future expiration, which requires special care
This issue is now dedicated to writing a tutorial on using subdomains + Far Futur expiration.
Comment #2
loparr CreditAttribution: loparr commentedHi,
Thank you. I figured it out - in mapping I put url of my subdomain. Now is it possible to restrict files that only images are served from subdomain?
Thank you
Comment #3
Wim Leers#2: Yes, do something like this:
That's all :)
Comment #4
alexweber CreditAttribution: alexweber commentedWould it be possible to alter the URLs so that the subdomain tp map directly into sites/default/files?
So the file "http://domain.com/sites/default/files/foo/bar.jpg" would have its path altered to "http://sub.domain.com/foo/bar.jpg"?
Comment #5
Wim LeersSeems many people are able to figure this out on their own, so not writing a tutorial for this.