1. Deploy
  2. Hosting site using Cloudflare


Hosting site using Cloudflare

integrating site with Cloudflare Pages

  1. Cloudflare Setup

    • Create a Cloudflare Account.

    • Add your site by entering your domain and following the steps.

    • Navigate to Workers & Pages and click on Create application and click on the Pages tab.

    • Click on Connect to Git and add your github repo. Under framework preset select Sveltekit. In the Environment variables section add all the secrets for production you have.

    • Make sure to test on a non master branch so your site is deployed on a cloudflare dev website until you are ready to showcase on your main site.

    1. Cloudflare Pages Custom Domains & Redirects

      • Once you have your site deployed in cloudflare, it will have a site name of .pages.dev. In order to make it point to your actual domain you need to Navigate to Workers & Pages -> YourSite->Custom Domains.Enter in your domain name.

      • In order for your site to be reachable using www..com you will need to create a Bulk Redirect List and redirect rule. Navigate to Bulk Redirects and click on Create Bulk Redirect List give it a name of www. Go to manually add URL redirects and under Source URL put in www..com and have it point to .com. Click on Edit parameters and select Preserve query string, Subpath matching, Preserve path suffix.