Skip to content

Instantly share code, notes, and snippets.

@dsandler
Created November 18, 2022 00:31
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save dsandler/1f94e95b9ea6cc7d5ec338c41e4b0bcd to your computer and use it in GitHub Desktop.
Save dsandler/1f94e95b9ea6cc7d5ec338c41e4b0bcd to your computer and use it in GitHub Desktop.
sloppy static webfinger for apache
# www/.htaccess
RewriteRule ^[.]well-known/webfinger.*$ /profile/me [L]
# www/profile/.htaccess
Header set Content-Type: application/jrd+json
Header set Access-Control-Allow-Origin: "*"
# www/profile/me
{
"subject": "acct:dsandler@dsandler.org",
"aliases": [
"https://mastodon.social/@dsandler"
],
"links": [
{
"rel": "http://webfinger.net/rel/avatar",
"href": "https://dsandler.org/avatar/1bit.png"
},
{
"rel": "http://webfinger.net/rel/profile-page",
"type": "text/html",
"href": "https://mastodon.social/@dsandler"
},
{
"rel": "self",
"type": "application/activity+json",
"href": "https://mastodon.social/@dsandler"
},
{
"rel": "http://ostatus.org/schema/1.0/subscribe",
"template": "https://mastodon.social/authorize_interaction?uri={uri}"
},
{
"rel": "me",
"href": "https://dsandler.org/"
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment