# ParkHillPartners — Namecheap Deployment Guide

This guide walks you through exporting and hosting the ParkHillPartners website on Namecheap.

---

## Overview

The website is built as a static React application with client-side routing. This means:
- All pages are pre-built as static HTML, CSS, and JavaScript
- No server-side processing is required
- Perfect for shared hosting like Namecheap
- Fast loading times and excellent SEO

---

## Step 1: Build the Static Export

### On Your Local Machine (or in the Manus sandbox)

Run the build script:

```bash
node build-static.mjs
```

This will:
1. Build the entire site with Vite
2. Generate optimised static files in the `dist/` folder
3. Create `.htaccess` (for Apache servers) and `web.config` (for IIS servers)
4. Output a summary of next steps

**Output:** A `dist/` folder containing:
- `index.html` — main entry point
- `assets/` — bundled JavaScript, CSS, and fonts
- `.htaccess` — routing configuration (Apache)
- `web.config` — routing configuration (IIS)

---

## Step 2: Prepare Files for Upload

### Option A: Using FTP (Recommended)

1. Download the `dist/` folder to your computer
2. Connect to Namecheap via FTP:
   - Host: `ftp.yourdomain.com` (or provided by Namecheap)
   - Username: Your Namecheap FTP username
   - Password: Your Namecheap FTP password
   - Port: 21 (or 22 for SFTP)

3. Upload all files from `dist/` to `public_html/`:
   - Upload the entire contents of the `dist` folder
   - Ensure `.htaccess` or `web.config` is uploaded (these are often hidden files)

### Option B: Using Namecheap File Manager

1. Log in to your Namecheap account
2. Go to cPanel → File Manager
3. Navigate to public_html
4. Click Upload and select all files from the `dist/` folder
5. Ensure hidden files (`.htaccess`, `web.config`) are uploaded

---

## Step 3: Configure Routing

### For Apache Servers (Most Common)

The `.htaccess` file handles client-side routing automatically. Ensure it's in `public_html/`:

```
<IfModule mod_rewrite.c>
  RewriteEngine On
  RewriteBase /
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule ^ index.html [QSA,L]
</IfModule>
```

If you don't see `.htaccess` after upload:
- It may be hidden. Enable "Show Hidden Files" in your File Manager
- Or create a new `.htaccess` file manually and paste the content above

### For IIS Servers (Windows Hosting)

The `web.config` file handles routing. Ensure it's in `public_html/`.

---

## Step 4: Verify Your Domain

1. Wait for DNS propagation (can take 24–48 hours)
2. Visit your domain in a browser: `https://yourdomain.com`
3. Test all pages:
   - Home page loads correctly
   - Navigation links work (About Us, Contact Us)
   - Images load properly
   - Forms are interactive

---

## Troubleshooting

### Pages return 404 errors
- Cause: Routing not configured correctly
- Fix: Ensure `.htaccess` (Apache) or `web.config` (IIS) is in `public_html/`
- Check: Contact Namecheap support to confirm your server type (Apache or IIS)

### Images not loading
- Cause: Image URLs are incorrect
- Fix: Verify all image URLs in the code are using the correct cloud CDN paths
- Check: Open browser DevTools (F12) → Network tab to see which images fail

### Styles look broken
- Cause: CSS files not loading
- Fix: Check browser DevTools for 404 errors on CSS files
- Check: Ensure all files were uploaded to `public_html/`

### Contact form not working
- Note: The contact form currently shows a success message but doesn't send emails
- To fix: You'll need to upgrade to a full-stack project with a backend email service

---

## Performance Tips

### Enable Gzip Compression

Add this to `.htaccess`:

```
<IfModule mod_deflate.c>
  AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css text/javascript application/javascript
</IfModule>
```

### Set Cache Headers

Already included in `.htaccess`:
- Static assets (JS, CSS, fonts) cache for 1 year
- HTML pages cache for 1 hour

---

## Updating the Site

To make changes and redeploy:

1. Edit the files in your local project
2. Run `node build-static.mjs` again
3. Upload the new `dist/` folder contents to `public_html/`
4. Clear your browser cache to see changes

---

## Support

For Namecheap-specific issues:
- Namecheap Support: https://www.namecheap.com/support/
- cPanel Documentation: https://docs.cpanel.net/

---

## Next Steps

Once your site is live on Namecheap:

1. Set up SSL/TLS — Namecheap provides free AutoSSL
2. Configure email — Set up MX records for domain email
3. Add analytics — Enable Umami analytics to track visitors
4. Connect a contact form backend — Upgrade to a full-stack project to wire the contact form to SendGrid or Resend

---

Last updated: May 2026
