Get a free website with any plan

See how
TROUBLESHOOTING

Why an AI-built site breaks after upload and how to fix it

Last updated

IN SHORT

Sites built by AI assistants break on Flashcloud when users upload raw project folders instead of compiled production files, miss .htaccess rewrite rules for single-page apps, or hardcode local machine paths. Build your assets locally with npm run build, place index.html directly into your document root, and append rewrite rules for client-side routing.

When code written by an AI assistant fails after you upload it, the issue is almost never the web server. Most failures trace back to three mistakes: uploading raw source files instead of compiled production assets, deploying client-side single-page apps without a rewrite rule in .htaccess, or hardcoding local machine paths and ports into server scripts.

Work through this checklist to identify what broke and put the fix in place. If your page loads as a blank white screen, a 404 on subpages, or a server error, you will find the remedy below.

1. Build files uploaded incorrectly

If you used a modern framework like React, Vue, or Vite, the AI tool likely produced a project folder containing src/, package.json, and configuration files. LiteSpeed does not run a compiler on incoming static files. It serves finished HTML, CSS, and JavaScript.

  • Build before uploading: Run npm run build on your local machine first. This creates a distribution folder, usually named dist/ or build/.
  • Upload the contents, not the folder: Upload the files inside dist/ directly to your site's document root. If your site is your primary domain, that root is public_html/. If it is a subdomain, the folder is ~/subdomain_name/ alongside public_html, not inside it.
  • Verify index.html sits at the root: Ensure index.html is directly inside your document root, not nested inside an extra subfolder like public_html/dist/index.html. A nested file produces a 403 Forbidden or 404 Not Found error on your domain root.

2. Client-side routes breaking with 404 errors

If your homepage loads cleanly but clicking a link or refreshing yourdomain.com/dashboard produces a 404 Not Found, your client-side router lacks server fallback rules. Single-page applications handle routing inside the browser. When a user requests a nested URL directly, the web server looks for a physical directory on disk and fails.

To fix this, edit the .htaccess file inside your document root via File Manager. Fresh document roots already contain server-generated blocks: always append your rules to the bottom of the file rather than replacing it. Add this block:

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

This tells LiteSpeed to serve your primary index.html file whenever a requested file or directory does not exist physically on disk, allowing your JavaScript router to handle the route.

3. Broken assets, casing errors, and temporary image URLs

AI assistants frequently write paths that work in a local preview but break on a production Linux server:

  • Case-sensitive filenames: Linux treats logo.PNG, logo.png, and Logo.png as three completely different files. Windows and macOS filesystems ignore casing, so your local machine might load an image that fails on the live host. Match the exact casing in your code to the filename on disk.
  • Absolute local paths: Check your HTML source for references starting with file:///, C:/, or /Users/. Change these to relative paths, such as ./images/photo.jpg, or root-relative paths like /images/photo.jpg.
  • Temporary AI chat image URLs: Many AI tools insert placeholder image URLs hosted on temporary CDNs (such as OpenAI or Anthropic asset domains). These links expire quickly and fail. Download the images, upload them to an assets/ or images/ folder in your document root, and update your code to reference the local copy.
  • Mixed content blocks: If your asset URLs begin with http:// on an encrypted page, modern browsers block them. Read our guide on fixing mixed content warnings to inspect console logs and correct lingering insecure paths.

4. Node.js backend configuration errors

If your AI project runs an Express or Node.js backend via cPanel's Setup Node.js App tool, common configuration traps include:

  • Hardcoding the listener port: AI models almost always output app.listen(3000) or app.listen(8080). On our platform, the LiteSpeed Node runner (lsnode) manages the socket dynamically. Your application must listen on process.env.PORT. Change your listener to app.listen(process.env.PORT || 3000).
  • Exposed API keys: Never hardcode API keys or database credentials into client-side JavaScript. For server apps, add your keys in the application's environment variables table in cPanel (select ADD VARIABLE, click SAVE, then RESTART).
  • Path mismatches on sub-paths: If you configure an app at yourdomain.com/api, LiteSpeed passes the full path to your script. Make sure your server routes account for the /api prefix rather than listening exclusively on /.
  • Startup crashes: If the app shows a 503 error, open File Manager and look for stderr.log inside your application root. This file logs the exact line causing Node to terminate.

5. Certificate warnings and browser cache

Two outside factors often make a working site look broken immediately after upload:

  • SSL certificate timing: Free Let's Encrypt SSL certificates issue automatically roughly five minutes after your domain's DNS points to our servers. If you upload your site before nameservers finish propagating, visiting https:// will show a browser security interstitial. Wait for DNS to point cleanly, and the certificate will issue. If you still encounter protocol issues afterward, see our walkthrough on why a site still shows http or mixed content after SSL.
  • Aggressive browser caching: If you uploaded an initial broken script, fixed it, and the page still will not load, your browser or CDN may be serving the broken asset. Use an incognito window, open your browser developer tools to disable cache, or navigate to Cloudflare CDN in the portal sidebar and select Purge cache.

When to open a support ticket

If you confirmed your build files are unnested, your rewrite rules are in .htaccess, and your Node app listens on process.env.PORT, but you still see persistent 500 errors, our team can check the server logs for you. Sign in to your portal at portal.flashcloud.com, go to Support, and open a new ticket. Our technicians are real humans and can pinpoint server-level permission blocks or execution faults quickly.

Common questions

Why do links give a 404 error on my single-page app?

Your single-page application lacks server fallback rewrite rules. Without them, LiteSpeed searches for a physical folder on disk for every nested URL and returns a 404. Append the rewrite rules to your .htaccess file so the server routes traffic through index.html.

Why do my images fail to load after uploading?

Your image paths either do not match the Linux filesystem or rely on expired URLs. Linux enforces case-sensitive filenames, blocks local machine paths like C:/, and temporary AI placeholder links expire quickly. Host images inside your document root, match the exact casing, and use relative paths.

Why does my Node.js backend show a 503 error?

Your Node application crashed on launch, usually due to a hardcoded port. Flashcloud dynamically assigns ports through LiteSpeed, so your script must listen on process.env.PORT instead of port 3000 or 8080. Check the stderr.log file in your application root to see the crash trace.

Why does my domain show a 403 Forbidden error after upload?

Your index.html file is nested inside an extra subfolder instead of your document root. Upload the loose contents of your dist or build folder directly into public_html rather than uploading the folder itself. Make sure index.html sits at the base of the root folder.

CAN'T FIND IT?

Real humans answer fast.

Hosting with us? Open a ticket and a real person replies - no scripts, no upsells. Still choosing a host? The same team is included with every plan, from day one.