404 The requested URL was not found on this server

Hello. I tried to host my website using a YouTube tutorial. I created my repository on GitHub. I purchased the domain from STRATO. I chose Cloudflare as the host. I received a message from Cloudflare saying that everything went well and that I am now protected by Cloudflare. However, I cannot access my website. I also do not see any error messages. Since I have no idea about this matter, I hope for help from those who know. What can I do to get help?

Best regards. Phil

The 404 error will be coming from the server you are pointing at. Either it isn’t set up to receive requests for your domain name or the page being requested doesn’t exist on the server (or you’ve entered the wrong IP address in the DNS).

Can you give the domain and show a screenshot of your Cloudflare DNS records?

1 Like

The 404 is coming from your host. Check that IP addresses are correct, check with your host that their end is working and that your files are uploaded.

HTTPS isn’t working so SSL isn’t set up either.

curl -Ivv http://81.169.145.158 -H "host:muenster-energieberatung.de"
*   Trying 81.169.145.158:80...
* Connected to 81.169.145.158 (81.169.145.158) port 80 (#0)
> HEAD / HTTP/1.1
> Host:muenster-energieberatung.de
> User-Agent: curl/7.81.0
> Accept: */*
>
* Mark bundle as not supporting multiuse
< HTTP/1.1 404 Not Found
HTTP/1.1 404 Not Found
< Date: Tue, 21 May 2024 20:56:53 GMT
Date: Tue, 21 May 2024 20:56:53 GMT
< Server: Apache/2.4.59 (Unix)
Server: Apache/2.4.59 (Unix)
< Content-Type: text/html; charset=iso-8859-1
Content-Type: text/html; charset=iso-8859-1
type or paste code here

When all is working ensure to set your SSL/TLS setting on Cloudflare to “Full (strict)”.

Before I commission the situation to a local expert, I would like to try to understand, as an amateur, what the connections are. I really hope that you have the patience and of course the time to guide me through this problem.
You write that the 404 comes from my host. The host is Cloudflare, correct? Now your advice is that I should contact cloudflare, correct? If I misunderstand you, please correct me. If you can guide me step by step through this labyrinth in detail, I would be grateful.

No, Cloudflare is not your host. The IP address 81.169.145.158 belongs to Strato AG, so either they, or a customer of theirs, is your web host. If they aren’t your web host, then you are pointing your Cloudflare DNS to the wrong IP address.

At STRATO I only purchased the domain. I have stored the name servers there. I will try to contact STRATO and give them your suggestions.

You’ve used their IP address in Cloudflare to point at hosting. If you don’t have hosting from them you’ll need to point at where your site is hosted. Do you actually have hosting yet? If not you’ll need to buy some. Either from them or someone else of your choice.

My opening post actually “describes” the possibility of hosting a website for free via Cloudflare. To do this, you have to upload the source code of the website to GitHub (done) and then host it on Cloudflare (a website is free). You buy the domain beforehand from a provider (in this case STRATO). The redirection is activated with the name servers 1+2, which are then stored with STRATO (domain). At least that’s how it was described in the YouTube tutorial. I hope I don’t misunderstand you.

Deploy your website for free with Cloudflare Pages and GitHub! - YouTube

You can host your website with Cloudflare Pages. That doesn’t require external hosting. But your initial problem was the 404, which is because you have no files on the server to which you have set your DNS to point at.

If you aren’t using external hosting, delete those DNS records and set your site up on Pages. When you create a custom domain in Pages, that will create DNS records for you.

1 Like

Unfortunately, I don’t understand exactly what to do. I uploaded my website to GitHub and deposited the reference on Cloudflare. Cloudflare has also confirmed that everything is OK. What exactly do you mean by your sentence? Which DNS records should I delete and where? And how do I integrate the purchased STRAO Internet address? The entry of the cloudflare nameservers on STRATO is just a redirect, isn’t it? A concrete step-by-step guide would be helpful. Of course, I fully understand if this is too time-consuming for you. The question is also: how do you convey this to a person without much background regarding network technology.

It’s ok, this can take a little time as following what you say may lead us down the wrong path while debugging your issue and your understanding.

We started with a 404 error, then find you have a Straro IP address, but now find you actually have deployed a Pages site.

Is your Pages site working ok when you access it through the pages.dev hostname?

When it does you can delete the A and AAAA records from your DNS and the CNAME for www. Then, under “Workers & Pages” in the Cloudflare dashboard, add a custom domain following these instructions…

Thank you very much. It worked and my website is online. I still have two questions. Do I have to make any settings on clouflare for a “better performance” and for the safety of the website? My second question: The website is now displayed, but the back grunting image is not. However, this is embedded and in offline mode it is also displayed correctly. I also see that the picture is not displayed on the smartphone. I just don’t see the mistake. Can you help me in this regard or should I write a new post in a programmer forum?

1 Like

It’s hard to give firm rules, you’ll learn more as you get more familiar with Cloudflare. As your site is on Pages there’s not really any tuning you can do as that’s optimised by Cloudflare already. You might add and adjust WAF rules over time to keep out bots and so on.

I’m not really a developer, but others may know. Otherwise you might look to join the Cloudflare Discord which has more developers hanging around than the Community…

1 Like

Thanks again. You guided me well through the labyrinth. I only wish you the best.

1 Like

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.