Your Website Works Locally but Breaks Online: What to Check

When a website works on your computer but breaks online, compare the local and hosted environments before rewriting the application. Start with the failing URL and its response, then check paths, configuration, runtime support, data, and permissions.

“Works locally” confirms that one environment can run the project. It does not establish that the server has the same files, settings, extensions, or database.

Identify the failure precisely

Open the browser’s Network panel, reload the failing page, and inspect the relevant request. Record the final URL and status. Check the console for script errors, then the hosting or application logs for the matching time.

SymptomFirst checks
Page or asset returns 404Upload location, spelling, case, routing, and the requested path.
Server returns 500Application error log, runtime compatibility, dependencies, and configuration.
Access returns 403Access rules, document root, ownership, and appropriate permissions.
HTML loads but data does notAPI address, HTTPS, credentials, allowed origins, and the data response.
Content changes do not appearWhich copy was deployed, cache layers, and the actual source being served.

A status narrows the investigation; it does not identify the exact cause by itself. A 500 response, for example, is a server failure category rather than proof of a database problem.

Check paths and filename case

A common deployment mistake is leaving a reference to localhost or a local drive path. To a visitor’s browser, localhost means the visitor’s own device, not your web server.

Also compare filename case. A development setup may tolerate a mismatch that the production filesystem does not. If the file is Logo.svg but the request asks for logo.svg, correct the reference or adopt a consistent naming convention.

Remember that browser URLs and server filesystem paths are different. An image URL points to a served resource; a PHP include points to a file the server reads. Replacing both with the same absolute web address is not a general solution.

Compare the runtime and build output

Check the required PHP, Node.js, or other runtime version and extensions against what the host provides. Read the project’s dependency and deployment instructions. A development server may build resources automatically while the host expects prepared output.

For more context, read our guide to learning web development with AI.

Verify that the deployment includes the correct production assets and required dependencies. Do not upload a development secret file into a publicly readable directory to make the application start.

Check environment settings and external services

Compare the names of required settings without exposing their values in public logs. Production needs its own database host, credentials, application URL, callback URLs, and supported service configuration.

If the page is HTTPS but calls an insecure HTTP endpoint, the browser may block the request. If an API is on another origin, investigate the API’s permitted-origin and credential rules. Do not “fix” the error by broadly allowing every origin with sensitive access.

Verify the database and writable locations

Confirm that the intended database exists, the schema is present, and the application account has only the access it needs. An empty database can produce a page that loads but has no content. A mismatched schema can produce an error even when the credentials work.

Identify the specific directories the application needs to write to, such as a private upload or cache location. Fix ownership and permissions deliberately. Making an entire website world-writable is not a sound deployment method.

You can also explore our guide to understanding the layers of a website.

Keep errors useful and private

Use server logs to investigate failures. A public error page should not reveal credentials, filesystem details, or stack traces containing private information. Turn on appropriate logging rather than enabling detailed error display for every visitor.

When asking for help, share the failing route, expected behaviour, timestamp, response status, and a redacted error. Never include a complete configuration file with passwords.

Retest the whole affected path

After the fix, revisit the original URL, its assets, and the action that failed. Test directly opening a deep link as well as navigating from the homepage. A rewrite rule can make one route work while breaking another.

Record the environmental difference and update the deployment instructions. The most useful fix prevents the next upload from repeating the same mistake.

Sources and further reading

Technical references checked during preparation on 13 November 2026. Examples and suggested workflows are editorial explanations, not reported client results.