Skip to content

Instantly share code, notes, and snippets.

@strlns
Created March 26, 2023 12:30
Show Gist options
  • Save strlns/fe9652ad9fbb5dee1fd136a81aceef9c to your computer and use it in GitHub Desktop.
Save strlns/fe9652ad9fbb5dee1fd136a81aceef9c to your computer and use it in GitHub Desktop.
.htaccess to serve markdown files with proper encoding (if the server doesn't)
# Rationale: My shared hosting at netcup serves UTF-8-encoded markdown files
# with Mojibake (especially important for Chromium which opens them directly as plaintext)
#
# MIME-Type text/markdown is new but pretty standard and well supported.
#
<IfModule mod_headers.c>
<Files "*.md">
Header set Content-Type 'text/markdown; charset=utf-8'
</Files>
</IfModule>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment