Cloudflare keeps caching 'direct' url.
Permalink 1 user found helpful
I'm trying to use cloudflare with my concrete5 site.
I have set up a direct.website.com subdomain for editing the site so cloudflare doesn't cache this. However, the site is consistently saving the 'direct' url in the hyperlinks, image sources ect which is causing the site to show up as insecure and redirecting users to the direct url.
How do you overcome this?
I've turned off concretes built in caching however it doesn't seem to of made a difference.
Thanks.
I have set up a direct.website.com subdomain for editing the site so cloudflare doesn't cache this. However, the site is consistently saving the 'direct' url in the hyperlinks, image sources ect which is causing the site to show up as insecure and redirecting users to the direct url.
How do you overcome this?
I've turned off concretes built in caching however it doesn't seem to of made a difference.
Thanks.
Have you tried setting the Canonical URL in the dashboard?
Hi Sorry for late reply,
I thought I solved this issue but it's still occurring. I've tried a load of different things all of which have failed including setting the canonical URL in the dashboard.
Right now it's setting up a 'CDN' environment from following a guide I seen used for amazon web services which I amended to work with cloudflare. This is an incredibly irritating issue.
Currently I have all concrete caching switched off.
It uses start.php to determine which environment to use (either normal, or CDN). I have verified this is working, it's serving the correct file.
Inside of cdn.concrete.php is the following code:
However, consistently links on the site and file paths are being saved as direct.website-name.co.uk. Driving me insane!
Thanks for your help.
I thought I solved this issue but it's still occurring. I've tried a load of different things all of which have failed including setting the canonical URL in the dashboard.
Right now it's setting up a 'CDN' environment from following a guide I seen used for amazon web services which I amended to work with cloudflare. This is an incredibly irritating issue.
Currently I have all concrete caching switched off.
It uses start.php to determine which environment to use (either normal, or CDN). I have verified this is working, it's serving the correct file.
Inside of cdn.concrete.php is the following code:
However, consistently links on the site and file paths are being saved as direct.website-name.co.uk. Driving me insane!
Thanks for your help.
Hi, did you manage to get this to work and what code did you use in start.php to determine which environment to use if the CDN is cloudflare?
Thanks
Thanks
No this still doesn't work 100%.
The code to detect environment is as follows:
As I said, this works in detecting and setting the environment but it still doesn't stop the URLs being cached.
The code to detect environment is as follows:
<?php use Concrete\Core\Application\Application; /** * ---------------------------------------------------------------------------- * Instantiate concrete5 * ---------------------------------------------------------------------------- */ $app = new Application(); /** * ---------------------------------------------------------------------------- * Detect the environment based on the hostname of the server * ---------------------------------------------------------------------------- */ $app->detectEnvironment( function(){
Viewing 15 lines of 21 lines. View entire code block.
As I said, this works in detecting and setting the environment but it still doesn't stop the URLs being cached.