<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed><type>rich</type><version>1.0</version><provider_name>phorkie</provider_name><provider_url>https://p.cweiske.de/</provider_url><title>Added WebFinger support to my email address using one rewrite rule and one static file.</title><author_name>Christian Weiske</author_name><cache_age>86400</cache_age><width>900</width><height>900</height><html>&lt;!-- embedding all files of https://p.cweiske.de/130 --&gt;
&lt;link rel="stylesheet" href="https://p.cweiske.de/css/embed.css"/&gt;
&lt;div class="phork" id="130"&gt;
    &lt;div class="phork-file"&gt;
 &lt;div class="phork-content"&gt;
  &lt;div class="code"&gt;&lt;pre class="txt"&gt;&amp;lt;Directory /var/www/profile&amp;gt;&#13;
    DefaultType application/json&#13;
    Header set Access-Control-Allow-Origin: &amp;quot;*&amp;quot;&#13;
&amp;lt;/Directory&amp;gt;&#13;
&#13;
RewriteEngine on&#13;
RewriteMap unescape int:unescape&#13;
RewriteCond ${unescape:%{QUERY_STRING}} resource=acct:(.+)&#13;
RewriteRule ^/.well-known/webfinger /profile/${unescape:%1}? [last]&lt;/pre&gt;&lt;/div&gt;

 &lt;/div&gt;
 &lt;div class="phork-meta"&gt;
  &lt;a href="https://p.cweiske.de/130/rev-raw/97dd233c54c75e8da454a33b71e1bc231ec483ab/famarier.txt" style="float: right"&gt;view raw source&lt;/a&gt;
  &lt;a href="https://p.cweiske.de/130#famarier.txt"&gt;famarier.txt&lt;/a&gt;
 &lt;/div&gt;
&lt;/div&gt;
    &lt;div class="phork-file"&gt;
 &lt;div class="phork-content"&gt;
  &lt;div class="code"&gt;&lt;pre class="txt"&gt;Actually there are three problems with this:&#13;
* URL-encoded query parameters are not unescaped prior to the mod_rewrite match&#13;
* the content-type is not set&#13;
* CORS headers are missing&#13;
&#13;
Here's my version:&#13;
This passes all of the checks on http://webfinger.net/&lt;/pre&gt;&lt;/div&gt;

 &lt;/div&gt;
 &lt;div class="phork-meta"&gt;
  &lt;a href="https://p.cweiske.de/130/rev-raw/97dd233c54c75e8da454a33b71e1bc231ec483ab/fmarier-comments.txt" style="float: right"&gt;view raw source&lt;/a&gt;
  &lt;a href="https://p.cweiske.de/130#fmarier-comments.txt"&gt;fmarier-comments.txt&lt;/a&gt;
 &lt;/div&gt;
&lt;/div&gt;
    &lt;div class="phork-file"&gt;
 &lt;div class="phork-content"&gt;
  &lt;div class="code"&gt;&lt;pre class="txt"&gt;[aaron@parecki.com www]$ cat .htaccess &#13;
RewriteEngine on&#13;
RewriteCond %{QUERY_STRING} resource=acct:(.+)&#13;
RewriteRule ^\.well-known/webfinger /profile/%1? [L]&#13;
&#13;
[aaron@parecki.com www]$ cat profile/aaron@parecki.com&#13;
{&#13;
  &amp;quot;subject&amp;quot;: &amp;quot;acct:aaron@parecki.com&amp;quot;,&#13;
  &amp;quot;links&amp;quot;: [&#13;
    {&#13;
      &amp;quot;rel&amp;quot;: &amp;quot;http://webfinger.net/rel/avatar&amp;quot;,&#13;
      &amp;quot;href&amp;quot;: &amp;quot;http://aaronparecki.com/images/aaronpk.png&amp;quot;&#13;
    },&#13;
    {&#13;
      &amp;quot;rel&amp;quot;: &amp;quot;http://webfinger.net/rel/profile-page&amp;quot;,&#13;
      &amp;quot;href&amp;quot;: &amp;quot;http://aaronparecki.com/&amp;quot;&#13;
    },&#13;
    {&#13;
      &amp;quot;rel&amp;quot;: &amp;quot;me&amp;quot;,&#13;
      &amp;quot;href&amp;quot;: &amp;quot;http://aaronparecki.com/&amp;quot;&#13;
    }&#13;
  ]&#13;
}&#13;
&#13;
&lt;/pre&gt;&lt;/div&gt;

 &lt;/div&gt;
 &lt;div class="phork-meta"&gt;
  &lt;a href="https://p.cweiske.de/130/rev-raw/97dd233c54c75e8da454a33b71e1bc231ec483ab/gistfile1.txt" style="float: right"&gt;view raw source&lt;/a&gt;
  &lt;a href="https://p.cweiske.de/130#gistfile1.txt"&gt;gistfile1.txt&lt;/a&gt;
 &lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
</html></oembed>
