Invisible Apache redirect

Posted by Guilhem Soulas on Server Fault See other posts from Server Fault or by Guilhem Soulas
Published on 2012-10-08T16:41:41Z Indexed on 2012/10/10 15:39 UTC
Read the original article Hit count: 240

Filed under:
|
|

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/.

© Server Fault or respective owner

Related posts about apache2

Related posts about ssl