I have noticed a strange behavior from the IPFS file explorer, the linked CID after “Index of /ipfs/” redirects to the root of the domain on which the gateway from where you access the files is running.
To what I’ve been testing, it seems to only do that on subdomain gateways though.
Meaning that, in the example below and in my personnal case also, if you are accessing files from a subdomain gateway running under “ipfs.example.com” the link will be “example.com/ipfs/CID”. So it ignores both the subdomain under which the gateway is running & the origin isolation of the subdomain gateway.
In my case it is pretty problematic as I have a website running on “example.com”, thus when we click on the link suggested by the file explorer it sends the user to my website & facing a beautiful 404.
The other issue in my case is that my gateway is not running on the same server as my website, making the matter even worse. I have tried setting up the nginx server on my website’s VPS to rewrite the URL to add “ipfs.” before “example.com” but for some reasons it instead sends to ipfs.io 's gateway.
If anyone knows why it behaves like that I’d love to know.