I presume that your use-case is a single-page application where you want to be able to have all URLs handled by the same client side code which has its router.
Currently, this is not something that is supported by IPFS gateways.
Yes, my use case is react or gatsby, where single or single/split app is used.
Yes, I am aware of the potential workarounds, but it would be good to have a first class HTTP content gateway.
I don’t think the pull request would address the same thing. HTTP redirects would not work in this context, would they?
In HTACCESS they talk about REWRITE, the URL as provided is right, but which file is going to handle is changed. This allows multiple URLs (Pattern) to be handled by the same File which will have to take the actual path as parameter in order to know how to render.
If you think about it, given that we serve the WebAPP ROOT by DNSLINK to a CID, there is already an “access” implementation in place that will take the path and match relative file path to find the content. That mechanism should be more powerful and allow multiple setttings.
There are other multiple problems that fall into this category, such as returning special headers, content types, redirects, etc.
I think IPFS http gateway needs an .htaccess equivalent solution. It is also important that this kind of rules can be distributed with the content, and not as infrastructure configuration.
200 Redirect will be treated as a rewrite, returning OK without changing the URL in the browser.
then this would be a neat solution.
and what about custom content-type or other headers, is there a solution already of being worked out? I guess it should be coherent with the _redirects file.
thanks @boris, @justincjohnson, I have also subscribed to notifications from the github PR.
As soon as you have a docker release I can test it. I have some applications in production that would benefit from this feature, like https://polkawatch.app where both UI and Data Packs are served over IPFS.