Redirection issue in a SSL virtual hose

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,
 
I have some applications which are running under Tomcat, in a directory called "www".  The Applications are called "Admin" and "Customer".  I use Apache to redirect and proxy into Tomcat.
 
I want to access my application using several URLS
 
http://www.company.com/
https://www.company.com/
 
These should point to https://www.company.com/Customer as this is the default customer landing point.  But also I need to use
 
http://www.company.com/Customer
https://www.company.com/Customer
 
http://www.company.com/Admin
https://www.company.com/Admin
 
So I have set up my redirects for http
 
<VirtualHost 1.2.3.4:80 >
        ServerName
www.company.com
        RedirectMatch Permanent ^/Customer(.*) https://www.company.com/Customer
        RedirectMatch Permanent ^/Admin(.*) https://www.company.com/Admin
        RedirectMatch Permanent ^/$ https://www.company.com/Customer
        RedirectMatch Permanent (.*)$ https://www.company.com/Customer
</VirtualHost>
<VirtualHost 1.2.3.4:443 >
        ServerName www.company.com
        SSLEngine On
        SSLCertificateFile conf/ssl/www.company.com.crt
        SSLCertificateKeyFile conf/ssl/www.company.com.key
        ProxyRequests Off
        AllowCONNECT 443
 
        <Location />
                Order deny,allow
                Allow from all
                ProxyPass
http://1.2.3.4:8080/www/
                ProxyPassReverse http://1.2.3.4:8080/www/
                ProxyPassReverse /www/
        </Location>
 
        DocumentRoot /usr/local/apache2/htdocs
</VirtualHost>
No problem here the http URLs work OK.
 
 
For the https URLs, the following work OK
 
https://www.company.com/Customer
https://www.company.com/Admin
 
BUT
 
https://www.company.com/ 
 
Does not work.  The request. and of course it should not, as we need
 
http://1.2.3.4:8080/www/Customer
http://1.2.3.4:8080/www/Admin
 
For the Tomcat application
 
https://www.company.com/ 
 
Results in
 
http://1.2.3.4:8080/www

Which does not point to the Tomcat application.
 
So what I need is some form of URL rewriting or redirection.  I tried adding a redirect into the SSL virtual host
 
<VirtualHost 1.2.3.4:443 >
        ServerName www.company.com
        RedirectMatch Permanent ^/$ https://www.company.com/Customer
 
I also tried rewriting. 
 
        RewriteEngine on
        RewriteRule ^/$ /Customer [R,L]
 
Neither are redirecting or rewriting the request for / into /Customer
 
So my URL of / proxised to http://1.2.3.4:8080/www/ and gives me an error as my application is not there.
 
Any suggestions at how to alias/rewrite/redirect/proxy the root to /Customer ?
 
Thanks
 
john
 
 
 

[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux