On again Off again 404 errors

@semicodin this is an interesting problem

I visited your this is how it should look link and this is how it looks
https://semicodin.nekoweb.org/origin/shape-outside_(URL)_01.html

I then copied the page source code and saved it to my website on infinityfree and the result is different !!
https://zoltar.eu.org/code/0001/shape-outside_(URL)_01.html

I don’t have an answer yet :confused:

---- edit ----

I did just notice an error message in the browser console

Cross-Origin Request Blocked: The Same Origin Policy
disallows reading the remote resource at
https://semicodin.nekoweb.org/origin/lucy_1310.png.
(Reason: CORS header ‘Access-Control-Allow-Origin’
does not match ‘https://nekoweb.org’).

It’s getting late, I have to start work now but I will come back to this after 19:00

2 Likes

Because you copied the entire source code without editing the page to fully localize it. I think this should be the problem. Both for your test and the OP @semicodin

5 Likes

I was thinking the same thing, I just don’t have the time right now to test it

cu later

3 Likes

Both the HTML file and the graphic(s) have to be in the same folder or you’ll get cross-origin errors and the page will not render correctly. That is why I place all shape-outside elements in a folder entitled “origin.” :face_with_monocle:

That’s not the correct way to deal with CORS here…

The path is just irrelevant here. THE IMAGE AND THE HTML MUST BE IN THE SAME SITE. But it’s not the case now; your site here still tries to load the image from the old nekoweb site which ALWAYS raises CORS errors here.

4 Likes

I only know that it displays correctly on nekoweb.

Yes, it displays correctly on nekoweb, because both the image and the html are on nekoweb and doesn’t raise CORS errors.

But your site here, however, while the html is served here, is still trying to load the image from nekoweb, which RAISES CORS errors and WILL PREVENT your site from working correctly.

Yes, I know, the “but it works on my computer” moment. But sometimes it is true that something is working from A doesn’t guarantee that it will work from B.

4 Likes

I have both the image and the HTML in the same folder here. I deleted the HTML from my directory and will double check that I have changed ‘Lucy’ (the image of the woman) from nekoweb to here. Just give me a minute . . .

I completely cleared my cache and verified the HTML points to infinityfreeapp for both the HTML and Lucy. The new file is named https://semicodin.infinityfreeapp.com/origin/shape-outside_url_01.html. This is a screenshot:

And this is likewise what I get in Chrome after going into incognito mode.

Listen. My final reply. Listen very carefully.

Yes, you put them in the same folder back in nekoweb. But then you moved site without also moving the images. So now they’re in different sites, and of course in different “folders” (if that still matters).

You may ask: But I moved the images? Well, the sad thing is, you have used absolute URLs that have the nekoweb site hardcoded into them. (really bad practice) Which means that the HTML pages doesn’t know they have been moved. They are still desprately trying to load images from the old nekoweb site, without success, due to the CORS policies.

In order to solve this, you have to update the URLs in your webpages to use the new domain. Or better, just use relative URLs. Only by doing this, the site knows that there’s also some images needed to be loaded here.
You cannot just copy everything over and hope the web server figure out the rest for you. Because it can’t, and won’t.

If you are still not getting this, then good luck. I don’t know how can I explain this issue better for you.

5 Likes

this is the solution :+1:

4 Likes

I see you changed the URL in the HTML, which is good, but you have to update the CSS too. Updating the HTML itself is not enough.

5 Likes

The solution was for Frank to point out that I had not one Lucy but two! For the life of me I do not understand why that is — there shouldn’t be cause for two of her; that must have been some failed prior coding effort on my part — but she is working now. :wink:

Edit: She had to be in the CSS also because of the shape-outside. As you can see, I am learning HTML . . .

3 Likes

I finally got some time to test this (I knew it would work but its always good to see it :rofl:)
https://zoltar.eu.org/code/0001/fixed.html

3 Likes

3 posts were split to a new topic: 403 Error

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