[Discuss] Trying to figure out Apache HTTP to HTTPS redirect

Rich Pieri richard.pieri at gmail.com
Tue Mar 21 11:56:58 EDT 2023


RHEL 9.1 if it matters.

Here's the configuration:

# Any request to root will be redirected to landing page
RewriteRule ^/$ /landingpage/index.html [R,L]

# Any request to any context will be redirected to HTTPS
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}$1 [R,L]

When I point my browser at http://myserver/ it redirects to
https://myserver/landingpage.html as expected. But when I point my
browser at https://myserver/ it does not redirect to the landing page
but instead displays the Apache test page.

Can anyone tell me what I'm missing here?

Thanks.

-- 
\m/ (--) \m/


More information about the Discuss mailing list