404 page is displayed strange

I have a custom 404 not found page on my site, which resides in the public folder, but it is displayed weird, like css style is broken. Also, its links don’t work. How to fix? Thanks

Is this the actual page you created in Sitely?
Can we have a look at the URL…

yes, it is, please have a look: https://colocalizer.com/mc/

Strangely, it is displyed correctly without slash in URL: https://colocalizer.com/mc

From what I can make out you have done good!
I’m seeing a Lato font style and all the links are going to right their places.

Maybe you have a cache issues?

It is not good, because displayed only without slash in URL, this is not how users make a typo. Try this: https://colocalizer.com/mc/ Its not a cache issue, I tested repeatedly

The URL you just gave me works the same. I placed the mc after your domain name and I see the wrong URL which in turn popped your 404 page.

So you are thinking if I place an incorrect URL then I should be seeing this https://colocalizer.com/404.html ? But to answer your question I’m not seeing the extra “/” that you are showing after “mc”.

I wonder if this is a configuration on your server?
Oh, I should add I tested your URL in Opera. For me Safari is starting to feel like Windows Explorer! :frowning:

This is what I see in Chrome. What server configuration should I check?

This is what I am seeing in Google Chrome…

Regards to server configuration… This is something I can’t answer for you. Maybe someone else can chime in on this. For me seeing the extra “/” isn’t important as the majority of people hardly ever properly look at the URL when they have made a mistake as a 404 page shows up for them to get them back to the right page(s).

I see the same in Chrome without /, but Sitely creates this page with slash and with slash this page almost useless. P.S. Thanks for trying to help. Please help me with compact menu.

The problem is with relative paths, your 404 page is at the top level, but with your configuration most likely the page source is being loaded in the mc subfolder, so the relative paths to css, images etc don’t work. The only configuration that works is if you redirect to the 404 page.

This makes sense. How do I redirect it?

this is where my 404 page resides on server:

It’s a server configuration, so it depends on your server. I have not tested this but for an apache server add this to a .htaccess file should work:

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^.*$ /404.html [R=302,L]
1 Like

It does work on my server, thanks!

we also have the issue with canonicalization (screenshot). I adde this to .htaccess file, but it didn’t solve the problem. Can you help?

RewriteEngine On
RewriteOptions InheritBefore
RewriteCond “%{HTTP_HOST}” “colocalizer.com$”
RewriteCond “%{REQUEST_URI}” “^/http://colocalizer.com
RewriteRule “." “http://www.colocalizer.com” [L,R=301]
RewriteCond “%{HTTP_HOST}” “^colocalizer-com[.]”
RewriteCond “%{REQUEST_URI}” “^/http://colocalizer.com
RewriteRule ".
” “http://www.colocalizer.com” [L,R=301]

Unfortunately the rewrite engine in apache is rather tricky and I’m not comfortable giving you suggestions without being able to test it. I’d suggest using chatgpt/gemini/claude/grok to generate a configuration, put it online and see if it works and does everything you need. That’s what I’d do anyway.

2 Likes

Thanks, but unfortunately I am not familiar with generating this configuration online.

Please explain how do I use chatgpt/gemini/claude/grok to generate a configuration. Thanks