This project is built using Vite + React. Below are the step-by-step instructions to host your website on popular platforms.
Vercel is the easiest platform for React/Vite projects.
- Push your code to a GitHub, GitLab, or Bitbucket repository.
- Go to Vercel and sign in with your Git provider.
- Click "Add New" > "Project".
- Import your
RED-EYE-LEAD-HUNTERrepository. - Vercel will automatically detect Vite. Ensure the settings are:
- Framework Preset:
Vite - Build Command:
npm run build - Output Directory:
dist
- Framework Preset:
- Click "Deploy". Your site will be live in seconds!
Netlify is another excellent choice for static site hosting.
- Push your code to GitHub.
- Login to Netlify.
- Click "Add new site" > "Import an existing project".
- Choose your Git provider and select your repository.
- Set the following build settings:
- Build command:
npm run build - Publish directory:
dist
- Build command:
- Click "Deploy site".
- (Optional) To fix React Router 404 issues on page refresh, create a
public/_redirectsfile with:/* /index.html 200
GitHub Pages is free and integrated directly into your repository.
- Go to your repository on GitHub.
- Click Settings > Pages.
- Under Build and deployment > Source, select "GitHub Actions".
- GitHub will suggest a "Static HTML" or "Vite" workflow. Search for "Vite" or use the official Vite starter workflow.
- Install the
gh-pagespackage:npm install gh-pages --save-dev
- Add these scripts to your
package.json:"predeploy": "npm run build", "deploy": "gh-pages -d dist"
- Run
npm run deploy. - In GitHub Settings > Pages, set the source to the
gh-pagesbranch.
If you are using Hostinger or any shared hosting with a File Manager/FTP.
- Install dependencies and build your project locally:
Open your terminal in the project folder and run:
npm install npm run build
- Locate the build folder:
This will create a
distfolder in your project directory. - Upload to Hostinger:
- Log in to your hPanel (Hostinger Control Panel).
- Go to File Manager.
- Open the
public_htmlfolder. - Upload all contents from your local
distfolder directly intopublic_html.
- Fix React Router (404 on refresh):
If your app has multiple pages/routes, create a file named
.htaccessin thepublic_htmlfolder and paste this:<IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteRule ^index\.html$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.html [L] </IfModule>
- Build Command:
npm run build - Output Folder:
dist - Environment Variables: If you have an
.envfile, make sure to add those variables in the Hosting Provider's dashboard (e.g., Vercel Project Settings > Environment Variables).
If you have a custom domain (e.g., www.redeye-leads.com):
- Go to the Domain Settings of your hosting provider (Vercel/Netlify).
- Add your domain.
- Update your domain's DNS records (A record or CNAME) as instructed by the provider.