Skip to content

Instantly share code, notes, and snippets.

@oliveratgithub
Created August 8, 2021 18:11
Show Gist options
  • Save oliveratgithub/d80b640a870c2da763ac7cbe59418552 to your computer and use it in GitHub Desktop.
Save oliveratgithub/d80b640a870c2da763ac7cbe59418552 to your computer and use it in GitHub Desktop.
A very simple .htaccess pretty URL rewrite for Apache2 HTTP Server
RewriteEngine On
RewriteRule ^([\w-]+)(?:\.html|/)?$ $1.html [NC,QSA,L]
# Makes something like "website.com/abc123" => work by delivering the file "/abc123.html"
@oliveratgithub
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment