Deploy
Hosting site using Cloudflare
integrating site with Cloudflare Pages
Cloudflare Setup
Create a Cloudflare Account.
Add your site by entering your domain and following the steps.
Navigate to
Workers & Pages
and click onCreate application
and click on thePages
tab.Click on
Connect to Git
and add your github repo. Under framework preset selectSveltekit
. 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.
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 tomanually add URL redirects
and underSource URL
put in www..com and have it point to .com. Click on Edit parameters
and selectPreserve query string
,Subpath matching
,Preserve path suffix
.