From e52132c85b1297a53911f97302546aab227097eb Mon Sep 17 00:00:00 2001
From: nisbet-hubbard <87453615+nisbet-hubbard@users.noreply.github.com>
Date: Wed, 12 Jul 2023 19:48:51 +0800
Subject: [PATCH] Use mod_alias for redirection
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
It’s a less resource-intensive alternative to mod_rewrite.
---
docs/config.md | 14 +++++---------
1 file changed, 5 insertions(+), 9 deletions(-)
diff --git a/docs/config.md b/docs/config.md
index 3577bb48..af84dae9 100644
--- a/docs/config.md
+++ b/docs/config.md
@@ -658,14 +658,13 @@ or the root domain:
# Higher than the max message size of 4096 bytes
LimitRequestBody 102400
-
- # Enable mod_rewrite (requires "a2enmod rewrite")
- RewriteEngine on
# Redirect HTTP to HTTPS, but only for GET topic addresses, since we want
- # it to work with curl without the annoying https:// prefix
- RewriteCond %{REQUEST_METHOD} GET
- RewriteRule ^/([-_A-Za-z0-9]{0,64})$ https://%{SERVER_NAME}/$1 [R,L]
+ # it to work with curl without the annoying https:// prefix (requires "a2enmod alias")
+
+ RedirectMatch permanent "^/([-_A-Za-z0-9]{0,64})$" "https://%{SERVER_NAME}/$1"
+
+
@@ -685,9 +684,6 @@ or the root domain:
# Higher than the max message size of 4096 bytes
LimitRequestBody 102400
-
- # Enable mod_rewrite (requires "a2enmod rewrite")
- RewriteEngine on
```