1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2013
    Rep Power

    RewriteEngine doesn't work with SSLEngine

    Hi recently I have migrated my application from http to https, I have added the SSL part to my apache web server on linux. The SSL is working fine. Every time I access my application I need to enter https which I dont want to do. So I tired to add the rewrite rule to the httpd.conf file. But it doesn't work, I have tried many ways but no use, did some R&D and what I have found is SSLEngine is blocking the RewriteEngine. When I comment SSLEngine the rewrite rule works perfect but the SSL is disabled. When I turn on SSLEngine the Rewrite rule doesn't work, Can any one help me please?

    This is the code from httpd.conf
    ##### Begin SSL Specific Configuration Options #####
    LoadModule ssl_module modules/mod_ssl.so
    include SSLv2-disabler.conf
    SSLRandomSeed startup builtin
    SSLRandomSeed connect builtin
    SSLEngine On
    SSLPassPhraseDialog exec:/WebAppSA/apache/V2.2/http-home/pfi-8398S/ssl.txt
    SSLCertificateFile /WebAppSA/apache/V2.2/certificates/myapp.com.cert
    SSLCertificateKeyFile /WebAppSA/apache/V2.2/certificates/myapp.com.key
    SSLCertificateChainFile /WebAppSA/apache/V2.2/certificates/ESSL_Intermediate_Apache.crt
    SSLSessionCacheTimeout 1000
    <Directory "/WebAppSA/pfi-8398S/cgi-bin">
        SSLOptions +StdEnvVars
    SetEnvIf User-Agent ".*MSIE.*" \
    nokeepalive ssl-unclean-shutdown \
    downgrade-1.0 force-response-1.0
    Include http-home/pfi-8398S/proxy_balancer.conf
    LoadModule rewrite_module modules/mod_rewrite.so
    RewriteEngine On
    RewriteCond %{HTTPS} off
    RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
  2. #2
  3. Impoverished Moderator
    Devshed Supreme Being (6500+ posts)

    Join Date
    Mar 2007
    Washington, USA
    Rep Power
    It's not "blocking" the rewriting.

    If you want to support http and https in any way whatsoever, and that includes supporting http just long enough to redirect someone to https, then you need two virtualhosts: one http, one https.
    Then put your redirection in the http virtualhost's configuration.

IMN logo majestic logo threadwatch logo seochat tools logo