Fix RewriteRule in htaccess for recent Apache
Ni!
Recent versions of Apache fixed a bug that interferes with how Hubzilla rewrites urls:
https://github.com/apache/httpd/commit/d78a166fedd9d02c23e4b71d5f53bd9b2c4b9a51
Here's an alternative RewriteRule that is compatible with (afaict) all Apache versions:
diff --git a/.htaccess b/.htaccess
index 3420313a5..98df30281 100644
--- a/.htaccess
+++ b/.htaccess
@@ -25,10 +25,12 @@ AddType audio/ogg .oga
# in CGI mode.
RewriteCond %{REQUEST_URI} ^/\.well\-known/.*
- RewriteRule ^(.*)$ index.php?q=$1 [E=REMOTE_USER:%{HTTP:Authorization},L,QSA]
+ RewriteRule ^(.*)$ index.php?q=$1 "[E=REMOTE_USER:%{HTTP:Authorization},L,QSA,B= ?]"
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
- RewriteRule ^(.*)$ index.php?q=$1 [E=REMOTE_USER:%{HTTP:Authorization},L,QSA]
+ RewriteRule ^(.*)$ index.php?q=$1 "[E=REMOTE_USER:%{HTTP:Authorization},L,QSA,B= ?]"
</IfModule>
I assume one could use the BCTLS flag for the same effect, but it ain't available on Apache < 2.4.57.