apache2 – How to Implement Nginx Configuration in Apache2 .htaccess

.htaccessApache2nginx

location /.well-known/webfinger {
   add_header Access-Control-Allow-Origin '*';
   return 301 https://mastodon.bitsnbytes.chat/$request_uri;
}

Is it possible to convert this Nginx into Apache2 .htaccess?

Best Answer

In Apache / .htaccess this would be something like:

Header always set Access-Control-Allow-Origin "*"

RedirectMatch 301 ^/(\.well-known/webfinger.*) https://mastodon.bitsnbytes.chat/$1
Related Question