]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
Rewrite guide: deduplicate HTTPS redirect recipe
authorRich Bowen <rbowen@apache.org>
Mon, 11 May 2026 19:31:10 +0000 (19:31 +0000)
committerRich Bowen <rbowen@apache.org>
Mon, 11 May 2026 19:31:10 +0000 (19:31 +0000)
avoid.xml had a full VirtualHost example for HTTP-to-HTTPS that was
identical to remapping.xml's version. Replace with a brief paragraph
and cross-reference to remapping.html#https-redirect, which covers
both the Redirect and .htaccess mod_rewrite approaches.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1934120 13f79535-47bb-0310-9956-ffa450edef68

docs/manual/rewrite/TODO.md
docs/manual/rewrite/avoid.xml

index d897d585bf711abc3fcb59884201dce3391e1d37..d89fbec441d084f0c6b691c80c2cbea699e369b3 100644 (file)
@@ -32,7 +32,7 @@ result in one file "owning" the content and others cross-referencing it.
       "canonicalhost" and "www-resolve" cover the same concept.
       → Merge "www-resolve" into "canonicalhost".
 
-- [ ] **HTTPS redirect** covered in both avoid.xml and remapping.xml.
+- [x] **HTTPS redirect** covered in both avoid.xml and remapping.xml.
       → remapping.xml owns the recipe; avoid.xml references it.
 
 ## LOW Priority
index 39b2e132a9d164b82be62cf0c3f3f6e0a40e665a..f2ce351fb1205b775bc5f3ae0f95220206c7d88d 100644 (file)
@@ -97,32 +97,13 @@ Redirect "/one/" "http://one.example.com/"
 <a href="remapping.html#canonicalhost">Canonical Hostnames</a>
 recipe.</p>
 
-<p>To redirect <code>http</code> URLs to <code>https</code>, do the
-following:</p>
-
-<highlight language="config">
-&lt;VirtualHost *:80&gt;
-    ServerName www.example.com
-    Redirect "/" "https://www.example.com/"
-&lt;/VirtualHost&gt;
-
-&lt;VirtualHost *:443&gt;
-    ServerName www.example.com
-    # ... SSL configuration goes here
-&lt;/VirtualHost&gt;
-</highlight>
-
-<p>The use of <code>RewriteRule</code> to perform this task may be
-appropriate if there are other <code>RewriteRule</code> directives in
-the same scope. This is because, when there are <code>Redirect</code>
-and <code>RewriteRule</code> directives in the same scope, the
-<code>RewriteRule</code> directives will run first, regardless of the
-order of appearance in the configuration file.</p>
-
-<p>In the case of the <em>http-to-https</em> redirection, the use of
-<code>RewriteRule</code> would be appropriate if you don't have access
-to the main server configuration file, and are obliged to perform this
-task in a <code>.htaccess</code> file instead.</p>
+<p>To redirect <code>http</code> URLs to <code>https</code>, a
+<directive module="mod_alias">Redirect</directive> in a dedicated
+HTTP virtual host is the cleanest approach. See the
+<a href="remapping.html#https-redirect">Forcing HTTPS</a> recipe for
+the recommended configuration and the
+<module>mod_rewrite</module> alternative for <code>.htaccess</code>
+use.</p>
 
 </section>