.htaccess SSL and Subdomain conflict

Discussion in 'Apache' started by physx, Aug 10, 2009.

  1. #1
    Hello,

    I wanted to do two things:
    1) force all http:// requests to use ssl
    2) force all "www.domain.com/* " requests to be "domain.com/* "

    I ACHIEVED THIS USING:

    RewriteEngine On
    RewriteCond %{HTTP_HOST} ^www.domain.com [NC]
    RewriteRule ^(.*)$ https://domain.com/$1 [L,R=301]
    RewriteCond %{HTTPS} off
    RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}


    BUT
    I need to access my subdomain: dev.domain.com without SSL. any way to do that?
     
    physx, Aug 10, 2009 IP
  2. eth1

    eth1 Peon

    Messages:
    10
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #2
    You can disable mod_rewrite inside the DocumentRoot .htaccess of the subdomain dev.domain.com

    This way requests for the subdomain dev.domain.com will be sent without being converted into https://
     
    eth1, Aug 11, 2009 IP