如何获取000webhost上已上传非index.html文件的URL?
Hey there! I’ve been in your exact situation—switching hosting providers and dealing with broken links is such a hassle. Let’s walk through how to track down those file URLs and get your site working properly:
1. Use 000webhost’s File Manager to Map URLs
Log into your 000webhost account, open the File Manager for your site, and head straight to the public_html folder—this is your website’s root directory (any file here is accessible via your domain).
- If you uploaded
about.htmldirectly intopublic_html, its URL isyour-domain.com/about.html - For files in subfolders (like
public_html/assets/css/style.css), the URL becomesyour-domain.com/assets/css/style.css
2. Test URLs Directly in Your Browser
If you remember the filenames you uploaded, you can guess and verify the URL right away:
- For a
contact.htmlfile, typeyour-domain.com/contact.htmlinto your address bar. If it loads, that’s your valid URL. - This works for assets too—try
your-domain.com/images/header.jpgif that’s where you stored your header image.
3. Confirm Files Are in the Right Folder
Double-check that all non-index files are uploaded to public_html (not a parent folder or random subdirectory). Files outside this folder won’t be accessible via your website, so move them into public_html if you misplaced them.
4. Fix Your Local Links
Once you have the correct URLs, update your HTML links to use reliable paths:
- Root-relative paths (most reliable): Use
<a href="/about.html">About</a>—this will always point toyour-domain.com/about.html, no matter which page you’re on. - Same-folder relative paths: If
about.htmlis in the same directory asindex.html,<a href="about.html">About</a>works too, but root-relative is better if you have subfolders.
Quick Pro Tips
- Watch for case sensitivity: 000webhost’s server treats
About.htmlandabout.htmlas different files—make sure your link matches the exact filename you uploaded. - Ditch spaces in filenames: Replace spaces with hyphens (
about-me.html) or underscores (about_me.html) to avoid messy URL encoding (likeabout%20me.html).
内容的提问来源于stack exchange,提问作者crystal_clam

