I am attempting to secure the admin pages (/admin/*) and login page (/user/login) to port 8443. I have successfully done that with the following in apache 2.4:
<VirtualHost _default_:443>
ServerName example.com:443
ServerAlias drupal
DocumentRoot "/opt/rh/httpd24/root/var/www/html/example.com/current"
<LocationMatch /(user|admin)>
Require all denied
</LocationMatch>
</VirtualHost>
<VirtualHost *:8443>
ServerName example.com:8443
ServerAlias drupal
DocumentRoot "/opt/rh/httpd24/root/var/www/html/example.com/current"
</VirtualHost>
The problem I am having is when I go to https://www.example.com:8443/user/login and login, I am redirected to http://www.example.com:8443/user/1.
This creates a 400 error - Bad request. Trying to serve http content over a SSL port.
How do I tell drupal to stay on https protocol and remain on port 8443?