Last active
April 6, 2025 02:26
-
-
Save aaronpk/5846789 to your computer and use it in GitHub Desktop.
Added WebFinger support to my email address using one rewrite rule and one static file.
This file contains hidden or 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
[aaron@parecki.com www]$ cat .htaccess | |
RewriteEngine on | |
RewriteCond %{QUERY_STRING} resource=acct:(.+) | |
RewriteRule ^\.well-known/webfinger /profile/%1? [L] | |
[aaron@parecki.com www]$ cat profile/aaron@parecki.com | |
{ | |
"subject": "acct:aaron@parecki.com", | |
"links": [ | |
{ | |
"rel": "http://webfinger.net/rel/avatar", | |
"href": "http://aaronparecki.com/images/aaronpk.png" | |
}, | |
{ | |
"rel": "http://webfinger.net/rel/profile-page", | |
"href": "http://aaronparecki.com/" | |
}, | |
{ | |
"rel": "me", | |
"href": "http://aaronparecki.com/" | |
} | |
] | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Alas according to the documentation
RewriteMap
cannot be declared in a per-directory context including.htaccess
. So one probably need to name their json files with%40
instead of@
or symlink them because some clients (e.g. Mastodon) send unescaped requests. This also requires to support both:
and%3a