Getting 5.7 working behind CDN
Permalink 1 user found helpful
Using this howto:http://www.concrete5.org/documentation/how-tos/developers/using-clo... I have tried to configure my c5.7 setup to run behind cloudflare, but am having mixed results. What I ave done so far is just try to configure C5 and apache to use a second hostname that will always bypass the CDN. So what I have is an alias of 'direct.mydomain.com' that points to the c5 root application directory. In config/app.php i have:
and in .htaccess, I have:
Which will not redirect requests to direct.* to www.*
this sort of works, but all images and links to absolute file paths are broken - I don't know if this is due to my config, or something else. Also, the sitemap in dashboard is empty when I try to access it from the direct.mydomain.com url path, even though I can log in ok and see the dashboard
and in .htaccess, I have:
RewriteEngine On RewriteBase / RewriteCond %{HTTP_HOST} !^direct\. [NC] RewriteCond %{HTTP_HOST} !^www\. [NC] RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]
Which will not redirect requests to direct.* to www.*
this sort of works, but all images and links to absolute file paths are broken - I don't know if this is due to my config, or something else. Also, the sitemap in dashboard is empty when I try to access it from the direct.mydomain.com url path, even though I can log in ok and see the dashboard
I actually got this working over the weekend. The above config DOES work, but there are several cloudflare specific things to make note of.
1. you can't load many Concrete5 specific javascripts async, so you need to set rocketloader to manual.
2. Anti leeching and anti-hotlinking CDN configs won't work. That's why images weren't working on my direct domain.
3. Adding: to does work to prevent getting forwarded to BASE_URL, What doesn't seem to work is the anti-crawler script. That seems to be handled somewhere else now, and adding it had no effect for me, but it's purely optional.
1. you can't load many Concrete5 specific javascripts async, so you need to set rocketloader to manual.
2. Anti leeching and anti-hotlinking CDN configs won't work. That's why images weren't working on my direct domain.
3. Adding: to
/application/config/app.php
Hi Nik,
I don't really get how this works.
Apart from what you have configured here-above, do you need to set something special at your images ? When I try it, it always gets the images from the base location.
What url do you use to access your server, direct. or www. ? How does it know it needs to get the static content from the direct. url ?
Thanks for your help.
Regards,
I don't really get how this works.
Apart from what you have configured here-above, do you need to set something special at your images ? When I try it, it always gets the images from the base location.
What url do you use to access your server, direct. or www. ? How does it know it needs to get the static content from the direct. url ?
Thanks for your help.
Regards,
If anyone does figure out how to get C5.7 running with a CDN (ex: MaxCDN!) I would love to know.