Invisible Apache redirect
- by Guilhem Soulas
I would like subdomain.mydomain.com to invisibly redirect to https://[myServerIP]:2083.
(There is an SSL issue here).
So far I managed to do it, but the redirection is visible and I don't want it:
RewriteCond %{HTTPS} off
RewriteCond %{HTTP_HOST} ^subdomain.\.mydomain\.com$
RewriteRule ^ https://[myServerIP]:2083/
Would it be a way to achieve the same redirection while maintaining permanently my beautiful "subdomain.mydomain.com" in the address bar?
EDIT with the ProxyPass directive:
I tried some variations with ProxyPass but it will still change the URL in the address bar:
ServerName subdomain.mydomain.com
<Location />
ProxyPass https://[myServerIP]:2083/
ProxyPassReverse https://[myServerIP]:2083/
</Location>
RewriteCond %{HTTPS} off
RewriteCond %{HTTP_HOST} ^subdomain\.mydomain\.com$
RewriteRule ^ https://[myServerIP]:2083/
EDIT2:
It still doesn't work:
#non SSL
ServerName subdomain.mydomain.com
#SSL!
<Location />
ProxyPass https://[myServerIP]:2083/
ProxyPassReverse https://[myServerIP]:2083/
</Location>
EDIT3:
It now works using the SSLProxyEngine directive:
SSLProxyEngine on
ServerName subdomain.mydomain.com
<Location />
ProxyPass https://[myServerIP]:2083/
ProxyPassReverse https://[myServerIP]:2083/
</Location>
I can now access my login interface (cPanel). However, once I'm logged in it doesn't redirect to the next page subdomain.mydomain.com/cpsess5850710203/.