Open darrelmiller opened 2 years ago
That's some impressive redirect hacking!
😬
So I've confirmed the behavior (not much doubt there) and I'm conflicted on where the problem is and what should be done to fix it:
index.html
? Is it clear which one "wins"? How would you get to the other one? If we start from is perspective, a couple other mitigations seem like good ideas:
/posts.html
under /posts/index.html
instead (and likewise for tags.html
).I don't know what the answer is. The rewrite rules do seem to be working for me at the moment but I have not tested extensively. I do think that having index.html in the posts folder rather than a posts.html and a posts folder would likely be a more resilient design for cleanblog. On the other hand, this is a funky issue caused by IIS insisting on putting a trailing slash on paths that point to folders even before the rewrite rules hit. I think it would probably be sufficient to have an issue in the cleanblog repo that warns people of the issue when hosting on IIS and suggests the alternative rewrite rules.
Cool - that's how I'll proceed for now if for no other reason than it's easy and I've been trying to focus on shipping Statiq Docs with what little time I've got. I'll leave this issue open to remind me to add something to the main docs as well.
I also opened issues for changing the CleanBlog files and implementing an analyzer for this situation - I think both are good ideas as time allows.
Thanks!
The rewrite rules do seem to be working for me at the moment but I have not tested extensively.
Hm, interesting. On my machine (Windows Server 2019 / IIS 10), your changed web.config
showed the same phenomenon for me. Individual posts work, but the tags
and posts
URLs throw a 404.
Shoving the posts.html
/tags.html
inside their folder as index.html
each did the trick.
Yeah, I also discovered the issue with tags. Although for some strange reason posts are working for me.
https://github.com/statiqdev/statiqdev.github.io/blob/91f859804f6eafdc1ebe0a574d65f7c25dca58bf/input/web/deployment/azure-app-service.md#L50
As the cleanblog created summary HTML files with the same name as folders, the above redirect rules failed to rewrite to the posts.html and the tags.html. I'm not sure if the right option is to change the cleanblog theme to create the posts.html as index.html in the posts folder and tags folder, but for the moment, the redirects below solved my problems.