Redirected to InfinityFree 404 error page

While working on your website, you may be redirected to the InfinityFree 404 error page. This article explains why this typically happens and what you can do to fix this.

Why do I get a 404 error

When you try to access a file on a website, the server tries to find the matching file to load. By default, it works like this.

Suppose you have a website http://example.com which is linked to the folder htdocs in your hosting account. If you then try to load a certain URL, like http://example.com/blog/images/gallery/photo.jpg, the server will map this path to the website folder. So the server will try to load htdocs/blog/images/gallery/photo.jpg.

If one of the folders in this path don’t exist, or don’t have a file with that name, the server will respond with a 404 Page Not Found error.

Note that the way files are loaded, as well as what happens when a file is not found, can be manipulated with .htaccess rules. The RewriteRule directives can be used to completely customize how files are loaded.

What can I do to fix this

There are a couple of common reasons why you may see a 404 error. Here are some things to look at while investigating 404 errors.

Check the home directory of your domain

In the Domains page of your account in the client area, you can find the domains of your account and the folders on your account they are linked to.

Please make sure that the domain folder listed there actually exists on your account (every URL will redirect to a 404 page if the domain’s website folder is missing), and that you uploaded your website files to that directory.

Check the referenced file is actually there

The section above describes how the server normally finds files on your account.

Make sure you’ve uploaded all files and folders successfully

If you’re uploading a website built elsewhere (either on your own computer or on a different hosting service), please make sure you’ve uploaded all files and folders to your account.

The most reliable way to upload an entire website is by using an FTP client like FileZilla. See the article How to upload files with FTP for more information.

Web hosting servers are case sensitive

The InfinityFree servers (like almost all hosting servers) run on a Linux operating system. And on Linux, the names of files and folders are case sensitive. This is different from Windows and MacOS, where files and folders are case insensitive.

This means that if you’re developing your website on Windows, you can refer to a file like http://example.com/background.jpg, and have a file called BackGround.JPG, and the URL will work. But when uploading this to a hosting server, this URL will suddenly return a 404 error.

Please be aware of this while developing on Windows or MacOS. It really helps if you are consistent with capitalization (e.g. never use any capital letters in file or folder names).

The htdocs folder is NOT visible in the URL

The base of your website is linked to a htdocs folder. This means that, by default, a file name on your account matches the path coming after the htdocs part.

So if you have a file with the path htdocs/about.html, the URL will be http://example.com/about.html and the file at htdocs/images/logo.png will have the URL http://example.com/images/logo.png.

In other words, the htdocs part should NOT be included in website URLs. Unless, of course, you create an additional folder with the name htdocs within your website’s htdocs folder (so htdocs/htdocs/photo.jpg).

Be aware of how URLs are evaluated

There are different ways to use URLs on a website.

A few ways to specify URLs are:

These can all be used successfully to refer to a particular file, but they all work slightly different. You should be aware of which method you are using and what the consequences are. This StackOverflow answer describes the differences very well.

Check any .htaccess rules for interference

The tips above all assume that you aren’t using any .htaccess rules to manipulate how files are loaded. However, .htaccess rules can be used to completely overhaul how URLs are mapped to files.

While .htaccess are a useful and powerful tool, it’s also possible to write bad .htaccess rules which cause URLs to generate 404 errors. So after considering the points above, you may want to check for and temporarily disable your .htaccess rewrite rules to see if they are responsible for sending your visitors to the 404 error page.

Why do I get a CORS error on the 404 error page

In your notice any missing assets on your page or failing background requests, you may see errors like this in the browser console:

Access to XMLHttpRequest at 'https://infinityfree.net/errors/404/' (redirected from '') from origin '' has been blocked by CORS policy: Response to preflight request doesn’t pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource.

The error message implies you need to add an Access-Control-Allow-Origin header to fix it. This is not the solution. As you can see, the page being loaded is our 404 page. And it’s true that our 404 page cannot be embedded in the websites of others.

Instead, the root cause is that one of the URLs being referenced in your website returns a 404 Page Not Found error. To fix this error, you need to find the URL that is causing the 404 error and fix it.

7 Likes
404 page not found on website
404 infinity error page
Getting 404 on in-site links
CORS policy
HTTP Request gives 302 Redirect
Blocked by robots.txt
Working migrated website has 404 errors
Contact form 7 not sending
Create and account using only a custom domain
Issue with Loading Resources (app.js and app.css) - 404 Error and CORB Blocking
Hello, I faced with the popular error - 403
How to upload files to your website?
Website 404 Not Found
My published SPA haven't been available more than 5 days
404 Error
Error 404-page no found
When displaying the income graphs by year, it shows me an error. I am using ChartJs
Uploading files to server
Got 404 error when i open my website
404 / Not Found
Error
Site not working well
404 error
How to get SSL on my php site?
Broken Image (Google Drive Link)
404 Not Found
404 error
Image not loading, and page
how to include a download button in my page that downloads a text file locate in the site files
404! we could not found that page
The css and javascript files are missing
Page 404 Not Found
Erro 404
Download button on my website is not working which is of JS DOM
Some pictures loading others not
Help getting the right URL right for files on my new website
We couldn't find that page
Error 404
It keeps showing me 404 error whenever I try to access any of the webpages
404 not Found
404 # We couldn't find that page. HELP
Robots.txt is unreachable
My website doesnt work after creation
Page viewing error
404!
Urgent Help Needed: 404 Error on InfinityFree Hosting
Fehler auf meiner Website
Error 404
404
My favicon icon is stuck as the wordpress logo
404 Not Found The page you were looking for could not be found!
Virus alert on infinityfree page
I got Cross-Origin Read Blocking (CORB) when html try to load photo from subfolder
404 Not Found Since Last Week
Blank page display
Page exist, but gives error 404
Index cannot read any files or folders
On again Off again 404 errors
Đ—roblem with access to site files, SSL error.
Can't access file
Website now extremely slow and files are unaccessible
Trouble Embedding HTML File From Directory
My website is not working
404 Even though files specified and uploaded
403 Forbidden - Server or website configuration is blocking you from viewing this page
Error 404
Why
Folder opening into an error message
404 Not Found on second website
Cannot access my website
Error 404
Images showing as dead boxes
FullCalendar not displaying x Bootstrap x MySQL
404 Not Found The page you were looking for could not be found!
Website redirecting to 404
Necessary Changes for my InfinityFree Hosted Website
404 unknow eror
My website is not working
404 Error
404 Error
All my pages except index.php do the 404 error
Cazc.org requires www. else goes to bogus site. epiz_32803965
All Pages are redirecting to Infinity free 404 page
404 Not Found
Problem with domain
My HTML Website doesnt show Media
Background video not showing
The page shows it can’t be reached
Error 404
404 error
The screen stays white
Http Error 500
404 error on internel page
Files run locally but not when I do it on a broser
Web is not loaded. index file and some more
Does Phaser work on this site?
404 problem
Why am I getting a 404?
It's been 72 hours but my site doesn't show up
404 Error on Subdomain
Problems with newly added files
Cors policy
CORS Policy Annoying Errors
Links to some jpg images not working
Has been blocked by CORS policy
Google Search Console not detecting my sitemap https://site.rf.gd/sitemap.xml? "Couldn't fetch"
None of my images are showing up or my music files
404 error when access file
Site navalforces.org
404 error The page you were looking for could not be found!
Can we provide clear explanation for cros blocking with infinityfree
Yoast Seo - sitemap Issue
Images not displaying
File Manager tree directory question
File Manager tree directory question
I am not able to enter my site
Domain Deleted
404 Error after creation of site
Website down 404. IP 185.27.134.113
Errors in css for a mini audio player
Website showing blank page
Redirect issue
404 error
Redirect issue
Redirect issue
404 error and more
403 error forbidden - Updated Faux Pizza site
404 not found
404
I add a Redirects to my web and now the page are not work
The link to index.html does not work
Request for Assistance with .htaccess File and Persistent Access Errors (403, 500, 505)
File upload
Why my page is not accessible only on mobile?!
How to enable mod_rewrite in infinityfree.net
My photos doesnt show
404 Not Found error on meraytstatus.in after proper setup
Problem uploading SSK Certificate
Site not opening
I can't open my web pages
This site can’t provide a secure connection
404 Error
404 Error
Delete and recover my domain
HTTP ERROR 400 error
Can some Check my Site?
I cannot link my index with the other pages
Dont have access to zip archive
Htdocs accidently deleted
Error 404 on my website, please help
Hosting Issue and Domain
Redirecting to wrong 404 page
Site reports 403 and 404
Cannot get to my website
Problem with hosting my new test website
What if I delete my only subdomain?
Just started my free site to test everything out
I'm having an issue implementing the Tawk.to live chats.
Link to picture on File storage
404 error
Apple Universal Links resulting in 404 error
Facing error 404 page from infintyfree
Infinifyfree is bad erro 404 login
Err
Website don't work
Cloudflare https://errors.infinityfree.net/errors/404/
Routu
Custom Error Page issue
Error 404 (my website is not working correctly)
Status Code: 404 Not Found Referrer Policy: strict-origin-when-cross-origin
Can't access to my website
Website not showing images and video, shows the placeholder icon alone

A post was split to a new topic: Need help with 404!