Created
September 2, 2017 15:42
-
-
Save drbyte/89cb9594e0f83b1c932e7470a38ced3e to your computer and use it in GitHub Desktop.
.well-known rewrites for apache
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ---------------------------------------------------------------------- | |
# Put well known resources in the .well-known folder | |
# https://github.com/fvsch/scripts-and-snippets/blob/master/apache/rewrite-well-known.conf | |
# ---------------------------------------------------------------------- | |
RewriteCond %{REQUEST_FILENAME} !-f | |
# Some very common, then less common "well-known" patterns | |
RewriteCond %{REQUEST_URI} =/favicon.jpg [OR] | |
RewriteCond %{REQUEST_URI} =/favicon.ico [OR] | |
RewriteCond %{REQUEST_URI} =/robots.txt [OR] | |
RewriteCond %{REQUEST_URI} =/crossdomain.xml [OR] | |
RewriteCond %{REQUEST_URI} =/apple-touch-icon.png [OR] | |
RewriteCond %{REQUEST_URI} =/apple-touch-icon-precomposed.png [OR] | |
RewriteCond %{REQUEST_URI} =/foaf.rdf [OR] | |
RewriteCond %{REQUEST_URI} =/w3c/p3p.xml [OR] | |
RewriteCond %{REQUEST_URI} ^/google[\da-f]{16}\.html$ [OR] | |
RewriteCond %{REQUEST_URI} ^/y_key_[\da-f]{16}\.html$ [OR] | |
RewriteCond %{REQUEST_URI} =/BingSiteAuth.xml$ [OR] | |
RewriteCond %{REQUEST_URI} =/myopenid-hosted-verification.html [OR] | |
RewriteCond %{REQUEST_URI} =/humans.txt | |
# To further limit possible issues (e.g. if you mess up the conditions above), | |
# we only match files at the root, not folders or files in subfolders | |
RewriteRule ^([a-z0-9\-\._]+)$ /.well-known/$1 [L,NC] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment