My site look perfect from localhost, but not from the internet. Why can’t I see styles and pictures on my website?
The simple answer is that all your generated links (in the HTML source of the page) are still probably using “localhost”…
If you load your website in your Browser (Chrome, IE, Firefox) from outside, right click on the page, and select ‘View Page Source’, you’ll see that all the links to the CSS and Graphic content (images) are either:
- Of the form http://localhost/ or http://127.0.0.1/
- Or using a domain-name that is made up or does not have proper global DNS set up.
None of these locations and URLs are reachable from outside. They are only reachable from the server (the local system).
You have to use a Domain Name for the website that is not localhost, a LAN IP, etc. That Domain Name should also resolve to the public IP address of the server, and not a local or LAN IP.
This could also be a webapp issue – for example, with WordPress originally installed for localhost, you’ll need to go into WordPress Setting, General Tab, and update/change the “wordpress address” and “site address” to a address other than “localhost” (an address that can be reached from outside).
* When you test your website again from outside, make sure to hard-refresh the page (in your Browser) by pressing Ctrl-F5 so everything is reloaded (so you don’t get cached pages and old results).