How to route a particular URL to both http and https and others to https in Apache

Discussion in 'Server Operation' started by uchmannuz, Sep 12, 2014.

  1. uchmannuz

    uchmannuz New Member

    I have a requirement to route a particular url, /gapp via http and https and other urls like /aapp, /bapp, /capp and the rest via https. I have succeded in routing everything to https but can't route /gapp to http. Below is my configuration:

    Code:
    <IfModule mod_rewrite.c>
    RewriteEngine on
    RewriteCond %{HTTPS} =on
    RewriteRule ^(gapp)$ http://%{SERVER_NAME}%{REQUEST_URI} [L,R]
    </IfModule>
    
    <IfModule mod_rewrite.c>
    RewriteEngine on
    RewriteCond %{REQUEST_METHOD} ^TRACE
    RewriteRule .* - [F]
    </IfModule> 
    
    # Should mod_jk send SSL information to Tomcat (default is On)
    JkExtractSSL On
    
    # What is the indicator for SSL (default is HTTPS)
    JkHTTPSIndicator HTTPS
    
    # What is the indicator for SSL session (default is SSL_SESSION_ID)
    JkSESSIONIndicator SSL_SESSION_ID
    
    # What is the indicator for client SSL cipher suit (default is SSL_CIPHER)
    JkCIPHERIndicator SSL_CIPHER
    
    # What is the indicator for the client SSL certificated (default is SSL_CLIENT_CERT)
    JkCERTSIndicator SSL_CLIENT_CERT
    
    # Send everything for context /examples to worker named worker1 (ajp13)
    # JkOptions indicates to send SSK KEY SIZE
    JkOptions +ForwardKeySize +ForwardURICompat -ForwardDirectories
    
    # JkRequestLogFormat
    JkRequestLogFormat "%w %V %T"
    
    JkMount /aapp aapp 
    JkMount /bapp/* bapp
    
    JkMount /capp capp 
    
    JkMount /gapp gapp 
    JkMount /gapp/* gapp 
    In simple words, I want to be able to do these:

    http://example.com/gapp/
    https://example.com/gapp/
    How do I accomplish this?
     

Share This Page