Skip to content

Instantly share code, notes, and snippets.

@aaronpk
Last active July 2, 2025 12:16
Show Gist options
  • Save aaronpk/5846789 to your computer and use it in GitHub Desktop.
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.
[[email protected] www]$ cat .htaccess
RewriteEngine on
RewriteCond %{QUERY_STRING} resource=acct:(.+)
RewriteRule ^\.well-known/webfinger /profile/%1? [L]
[[email protected] www]$ cat profile/[email protected]
{
"subject": "acct:[email protected]",
"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/"
}
]
}
@fmarier
Copy link

fmarier commented Jun 26, 2025

@roseeng
Copy link

roseeng commented Jul 2, 2025

@roseeng According to the spec, the correct test URLs should use resource= instead of profile=:

* https://fmarier.org/.well-known/webfinger?resource=acct:[email protected]

* https://fmarier.org/.well-known/webfinger?resource=acct%3Afrancois%40fmarier.org

Right, I mixed up the url parameter and the folder name. Fixed.

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