How can I redirect HTTPS to HTTP in .htaccess for specific domains?

Discussion in 'Site & Server Administration' started by bd.rutl, May 11, 2015.

  1. #1
    We host a number of websites on our server. Our main site, let's call www.domain.com.

    Anyway, we noticed that the other sites we host, for instance, www.domain-a.com, www.domain-a.com, etc, all point back to our main site (www.domain.com) when https:// is put in front of their domain. Part of the problem is that these are indexing in Google as well.

    I need to make sure the https:// sites point to their respective sites rather than the main one. I'm wondering how I can do these redirections in the htaccess?? Please help!
     
    bd.rutl, May 11, 2015 IP
  2. OlgaSeCom

    OlgaSeCom Active Member

    Messages:
    19
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    56
    #2
    Do you use control panel on this hosting site?
     
    OlgaSeCom, May 12, 2015 IP
  3. bd.rutl

    bd.rutl Peon

    Messages:
    3
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    1
    #3
    No we do not. There isn't any graphical user interface. A small IT company runs the hosting environment for us, and they're not sure how to approach the issue.
     
    bd.rutl, May 12, 2015 IP
  4. PoPSiCLe

    PoPSiCLe Illustrious Member

    Messages:
    4,623
    Likes Received:
    725
    Best Answers:
    152
    Trophy Points:
    470
    #4
    Why is this even an issue? Whomever did the setup of the different domains did a crappy job - regardless of protocol, it should still redirect to the given domain, not fall back to a default domain.
     
    PoPSiCLe, May 12, 2015 IP
  5. GORF

    GORF Well-Known Member

    Messages:
    224
    Likes Received:
    21
    Best Answers:
    3
    Trophy Points:
    165
    #5
    Are you familiar with the typical cPanel/Apache setup? This happens all the time. It doesn't always "just work" like it is supposed to. ("Should" is a very relevant word!)

    Any suggestions instead of stating the obvious?
     
    GORF, May 12, 2015 IP
  6. OlgaSeCom

    OlgaSeCom Active Member

    Messages:
    19
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    56
    #6
    You should add dummy httpd virtualhost to you apache config like (this virtualhost should be above your another virtualhosts)
    <virtualhost *:443>
    server name default.domain
    documentroot /var/www/html
    </virtualhost>

    and then all reqests to https:// your.ip or https:// any.domain will show default page from /var/www/html
    And another https sites from apache config will shows correctly


    ____
    www. secom. pro
     
    OlgaSeCom, May 13, 2015 IP
  7. John Dave

    John Dave Active Member

    Messages:
    873
    Likes Received:
    35
    Best Answers:
    10
    Trophy Points:
    80
    #7
    You could simply add another RewriteCond to check if the host is metrikstudios.com

    RewriteCond %{HTTP_HOST} ^metrikstudios\.com [NC]
     
    John Dave, May 13, 2015 IP