Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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

share|improve this question
    
You have a problem with your terminology here. What you want is not a redirect -- redirects by definition are not invisible in the way that you want. So you've asked for a contradiction. –  Mike Scott Oct 8 '12 at 17:12
add comment

2 Answers 2

up vote 2 down vote accepted

You could achieve your objective (of not changing the address bar) with a ProxyPass and ProxyPassReverse directive. Eg:

<Location />
ProxyPass https://[myServerIP]:2083
ProxyPassReverse https://[myServerIP]:2083
</Location
share|improve this answer
    
I tried it (see my edit) but don't know how to get my result. –  Guilhem Soulas Oct 9 '12 at 7:03
    
As @Christopher Perrin said in his comment, you'll want to remove (or comment out) the rewrite. –  James Yale Oct 9 '12 at 11:30
    
Still doesn't work :( I answered on @Christopher Perrin thead. –  Guilhem Soulas Oct 10 '12 at 13:56
1  
    
Good point, forgot about the SSL proxy requirement. –  James Yale Oct 10 '12 at 14:32
show 5 more comments

What you are looking for is a reverse proxy

share|improve this answer
    
Thanks mate but I can't make it work (see my edit). –  Guilhem Soulas Oct 9 '12 at 7:02
1  
Of course you have to keep the rewrite away. –  Christopher Perrin Oct 9 '12 at 10:18
    
I tried hard but it doesn't work. Because of the fact that my subdomain is HTTP but the proxy is HTTPS. If I put a simple HTTP proxy it works well. Thanks. –  Guilhem Soulas Oct 10 '12 at 13:56
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.