404 on Redirects

Hi, I have an issue in redirects
One of my team member personal website (https://amirmohammadsafari.ir) has a redirect file _redirect
in It’s output folder as described in cloudflare docs

Contains :

/rss https://amirmohammadsafari.ir/feed.xml 301
/blog https://amirmohammadsafari.ir/posts 301

/gh https://github.com/nuxsco 301

/intro https://intro.jarvismercer.ir 301

The problem is when a user visit our websire for the first time like we giving an address (بلاگ - امیرمحمد) and send this in telegram or whatsapp for example
If user click on this it will redirect correctly

But
If user clikc on this for SECOND time it will give us our 404 page
In PC we checked
If we open the page in incognite mode it will work but if we open in second time it will give us our 404
AND
When we use CTRL+SHIFT+R for hard refresh on 404 page with بلاگ - امیرمحمد it will redirect correctly!!

For more clear and reproduce error
Please open this link in normal browser (PC/MOBILE)

This link should redirects to بلاگ - امیرمحمد

Now after 3 ~ 5 min again in another tab open بلاگ - امیرمحمد again.

It will give 404 instead redirects to our /posts

What happened here ?
Why redirects won’t work after second visit and why they need HARD REFRESH for working after first time visit?

Website hosted in Cloudflare pages
Website written in VueJS 3 + Nuxt

If you need any other information please say I ll tell you

Hi,

Thank you for reaching out to us. I’ve been trying to reproduce the issue you’re experiencing following the steps you’ve provided us with without success. Have you tried reproducing this issue using incognito mode? Also, you can refer to our documentation for further information regarding this: 4xx Client Error · Cloudflare Support docs . Please note that Cloudflare does not generate 404s for customer websites, we only proxy the request from the origin server.

Kindly,

Sadly, I am still working on this
There are some clues I found tho
1 - sw.js
I think this can cause problem

2 - Cookie
I don’t know yet

Please try this for better understanding the issue (BOTH NORMAL BROWSER) no private mode or anything else:

Test Page
[“https://antfu-me.pages.dev/avatar.png”]

Customer fork page which is main page
[“https://amirmohammadsafari.ir/avatar.png”]

Use Inspect tools and go to network tab

in the first one
avatar.png content type is png and 302 not modified

second one
avatar.png is document HTML 200 OK text/html; charset=utf-8 as content type

Why ?

Second one has sw.js first one doesn’t have

Thanks anyway

I fixed the issue

It was SW.js - Service Worker and Workbox for PWA to making a website work offline
And Register.js for assets integration

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