Skip to content

Add slash to .htaccess HTTPS redirect examples#689

Open
deprrous wants to merge 1 commit into
apache:trunkfrom
deprrous:pr/httpd-htaccess-redirect-slash
Open

Add slash to .htaccess HTTPS redirect examples#689
deprrous wants to merge 1 commit into
apache:trunkfrom
deprrous:pr/httpd-htaccess-redirect-slash

Conversation

@deprrous

Copy link
Copy Markdown

These rewrite recipes are presented as .htaccess / per-directory examples.

In that context the matched path does not include a leading slash, so the absolute redirect target needs an explicit / between the authority and $1.

Copilot AI review requested due to automatic review settings July 26, 2026 11:27

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the mod_rewrite HTTPS-redirect recipes in the docs to be correct for .htaccess / per-directory context, where the matched path does not include a leading /, by inserting an explicit / between the authority and the captured path.

Changes:

  • Update multiple .htaccess HTTPS redirect examples to use https://%{SERVER_NAME}/$1 instead of https://%{SERVER_NAME}$1.
  • Keep the redirect examples aligned with per-directory rewrite rule semantics.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@@ -190,7 +190,7 @@ RewriteRule "^(.*)" "https://%{SERVER_NAME}$1" [R=301,L]
RewriteEngine On
RewriteRule "^/\.well-known/acme-challenge/" - [L]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants