Boston Linux & UNIX was originally founded in 1994 as part of The Boston Computer Society. We meet on the third Wednesday of each month, online, via Jitsi Meet.

BLU Discuss list archive


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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



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/



Valid HTML 4.01! Valid CSS!



Boston Linux & Unix / webmaster@blu.org