Neat tip for clean URLs
6th August 2003
Here’s one of the neatest tips for clean URLs I’ve seen yet, from Thijs van der Vossen. He’s come up with a mod_rewrite rule that checks to see if the requested file exists if you add .html on to the end of it, and serves it up if that’s the case. I’m posting the full code snippet here because it’s just too good to risk losing to link-rot in the distant future:
RewriteEngine on RewriteBase / RewriteCond %{REQUEST_FILENAME}.html -f RewriteRule (.*) $1\.html [L]
More recent articles
- Porting the Moebius 0.2B image inpainting model to run in the browser with Claude Code - 22nd June 2026
- sqlite-utils 4.0rc1 adds migrations and nested transactions - 21st June 2026
- Datasette Apps: Host custom HTML applications inside Datasette - 18th June 2026