# Cloudflare Pages Deployment Guide
**Project:** BILIVINE Recruitment Content & SEO Hub  
**Hosting Platform:** Cloudflare Pages  
**Target Domain:** `bilivine.pages.dev`

---

## 1. Overview
This guide details the step-by-step process for deploying the BILIVINE recruitment content hub and SEO pages to Cloudflare Pages. Cloudflare Pages offers global edge delivery, automatic SSL, instant cache invalidation, and seamless integration with Git repositories.

---

## 2. Prerequisites
- A Cloudflare account with access to **Cloudflare Pages**.
- A Git repository (GitHub or GitLab) containing the built static site or markdown/HTML source files.
- Node.js (v18+) or a static site generator (Hugo, Astro, Next.js, or vanilla HTML/Markdown).

---

## 3. Deployment Steps via Git Integration
1. **Connect Repository:**
   - Log into the [Cloudflare Dashboard](https://dash.cloudflare.com/).
   - Navigate to **Workers & Pages** > **Create application** > **Pages** > **Connect to Git**.
   - Authorize Cloudflare to access your GitHub repository containing the BILIVINE project.
2. **Configure Build Settings:**
   - **Production branch:** `main` (or `master`)
   - **Framework preset:** None (or Static HTML / Hugo / Astro depending on your build setup).
   - **Build command:** `npm run build` (or leave blank if deploying static markdown/HTML files directly).
   - **Build output directory:** `dist` (or `public` or root `/` depending on configuration).
3. **Environment Variables:**
   - Add any required production environment variables (e.g., `NODE_VERSION = 18`).
4. **Save and Deploy:**
   - Click **Save and Deploy**. Cloudflare will clone the repository, run the build command, and deploy the assets to the global edge network within seconds.

---

## 4. Custom Domain & Routing Configuration
1. Navigate to your deployed project in Cloudflare Pages (`bilivine.pages.dev`).
2. Go to **Custom domains** > **Set up a custom domain**.
3. Enter your primary domain (e.g., `bilivine.com` or subdomain).
4. Cloudflare will automatically configure DNS CNAME records pointing to your Pages project.

---

## 5. Redirects and Headers (`_redirects` & `_headers`)
To ensure clean URL slugs (e.g., `/recruiting/recruitment-crm-vs-ats`) without `.html` extensions and enforce robust caching policies, include the following configuration files in your root public directory:

### `_redirects`
```text
/recruiting/recruitment-agency-candidate-management-multiple-vacancies /recruiting/recruitment-agency-candidate-management-multiple-vacancies.html 200
/recruiting/recruitment-crm-vs-ats /recruiting/recruitment-crm-vs-ats.html 200
/recruiting/ats-features-for-recruitment-agencies /recruiting/ats-features-for-recruitment-agencies.html 200
/recruiting/recruitment-agency-candidate-database /recruiting/recruitment-agency-candidate-database.html 200
/recruiting/cv-parsing-recruitment-agencies /recruiting/cv-parsing-recruitment-agencies.html 200
/recruiting/duplicate-candidate-records-recruitment-database /recruiting/duplicate-candidate-records-recruitment-database.html 200
/recruiting/reduce-manual-candidate-sourcing /recruiting/reduce-manual-candidate-sourcing.html 200
/recruiting/automated-candidate-job-matching /recruiting/automated-candidate-job-matching.html 200
/recruiting/talent-pipelines-recruitment-agencies /recruiting/talent-pipelines-recruitment-agencies.html 200
```

### `_headers`
```text
/recruiting/*
  X-Frame-Options: SAMEORIGIN
  X-Content-Type-Options: nosniff
  Referrer-Policy: strict-origin-when-cross-origin
  Cache-Control: public, max-age=3600, stale-while-revalidate=86400
```
