logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Apache View previous topic :: View next topic
Reply to topic   Topic: Three domains with wildcard ssl - http redirects to one
Author
pschmehl



Joined: 13 Oct 2017
Posts: 16
Location: United States, Richardson, TX

PostPosted: Mon 07 Jan '19 23:40    Post subject: Three domains with wildcard ssl - http redirects to one Reply with quote

I have an apache24 server that runs three domains; www, blog, and wiki. All three domains are https, but if you go to any one of them using http instead of https, they all redirect to blog. How do I get each domain to redirect correctly?

I have RedirectPermanent / domain.vvfh.org in the conf files, but it doesn't work. Everything goes to https://blog.vvfh.org/. Obviously, this is undesirable behavior.

What's the correct way to handle this?
Back to top
pschmehl



Joined: 13 Oct 2017
Posts: 16
Location: United States, Richardson, TX

PostPosted: Tue 08 Jan '19 0:30    Post subject: Reply with quote

This seems to have done the trick:

RewriteEngine on
RewriteCond %{HTTPS} !=on
RewriteRule .* https://%{SERVER_NAME}%{REQUEST_URI} [R,L]

Added to the port 80 section of each vhost. Previously I was using RedirectPermanent / https:/domain.vvfh.org, which was not working.
Back to top


Reply to topic   Topic: Three domains with wildcard ssl - http redirects to one View previous topic :: View next topic
Post new topic   Forum Index -> Apache