Adding cloudflare to a php website on bluehost

dash-crypto
#1

I am planning on adding cloudflare to a website. If anyone can clarify a few things that are unclear at the moment, I would much appreciate that.

  1. My website makes a few ajax calls to urls that get processed via php, directory index is index.php, loading as /directory/. Will I need to configure anything in Cloudflare so that ajax files are not cached (and processed on the host server) but the directory index is cached.
  2. What will happen to the apache .htaccess redirect rules I have on my server? Do I need to configure anything to have them working as before?
  3. Anything else I need to configure or be aware of before/after the migration?
#2

First, you will need to set up a dedicated page rule to get that directory path cached. By default it is not. Second, where do these AJAX calls go to? The same directory path?

The will be still executed in your server’s context.

If you plan to use HTTPS, make sure you have a proper certificate on your server and Cloudflare’s SSL mode set to “Full strict”. If you use any domain hosts for e.g. database calls you should replace them with the IP or make sure they are not proxied on Cloudflare. Same goes for any HTTP calls to your own site. These should be (best) converted to local function or database calls without using the HTTP layer at all.

#3

Hey, thanks for your reply Sandro.

I’ve got two calls, one in the same folder and another to a different folder ( one up ).

I’ve been using letsencrypt cert that came with Bluehost hosting. Is that considered a proper certificate?

Is there any documentation specific to the static php sites I can read through before activating Cloudflare’s caching.

#4

If you cache the path you might run into issue with the AJAX call.

It is.

Static and PHP are somewhat exclusive :slight_smile:

support.cloudflare.com covers most topics.