4 ms·
> I do things like serve html without the .html filetype in the url; e.g. https://zck.org/emacsconf2020 https://zck.org/emacsconf2020 is stored on the server as
by johnx123-up 6y ago
> I do things like serve html without the .html filetype in the url; e.g. https://zck.org/emacsconf2020 https://zck.org/emacsconf2020 is stored on the server as emacsconf2020.html
How do you handle it?
- zck 6y agoIn the .htaccess: RewriteEngine on RewriteCond ${REQUEST_FILENAME} !-D RewriteRule "^((?:.*/)*[^/.]+)$" "$1.html" [NC]
- johnx123-up 6y agoThank you
- hunter2_ 6y agoAny reason not to just use Options MultiViews instead?
- zck 6y agoMainly because I did not know that existed. I'll have to test it before thinking about switching it out. I wonder if there's some sort of unit test suite for .htaccess configurations -- big changes like this could definitely break something, and my config works for me now. It does seem like it might be more magic than I prefer in programming, though.