Last active
October 10, 2025 15:42
-
-
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/" | |
| } | |
| ] | |
| } | |
@roseeng According to the spec, the correct test URLs should use
resource=instead ofprofile=:* https://fmarier.org/.well-known/webfinger?resource=acct:francois@fmarier.org * https://fmarier.org/.well-known/webfinger?resource=acct%3Afrancois%40fmarier.org
Right, I mixed up the url parameter and the folder name. Fixed.
I had to change the rewrite rule to this to make it work:
RewriteRule ^/.well-known/webfinger /profile/%1? [L](forward slash instead of backslash)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@roseeng According to the spec, the correct test URLs should use
resource=instead ofprofile=: