• Hi! I have a website with an SSL installed. Right now, I have my HTACCESS file forcing HTTPS on all pages and sites. It works fine. I also have the HTTPS plugin.

    Instead of buying a WildCard SSL for my subdomains, I decided I don’t need HTTPS for my subdomains. I’d like to do something to my site so it forces HTTP on subdomain sites and HTTPS on my main site. The solution must be to do something in my HTACCESS file, but I’m not sure what. I’ve tried doing some ‘ignore’ commands like I’ve seen on other posts, but it’s not working out for me.

    I’d like mysite.org to be HTTPS and subdomains, like ps.mysite.org, to be HTTP.

    Here’s a copy of part of my script:

    # BEGIN HTTPS Redirection Plugin
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteCond %{SERVER_PORT} !^443$
    #RewriteCond %{HTTP_HOST} !^ps\.
    RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
    </IfModule>
    # END HTTPS Redirection Plugin

    The part I #’ed out is not working as it should, but I expected it to ignore the forced HTTPS if I’m on the ‘ps’ subdomain.

    Do you have any idea what I can do to make this work? I’d appreciate any advice you can give me!

    Thanks,
    M

Viewing 6 replies - 1 through 6 (of 6 total)
  • The .htaccess files affect the folder they are in and any folder under them.
    Are your subdomain folders under the root domain folder? (they sometimes are not)
    Does a request to a subdomain actually go to the root domain folder, or is the subdomain folder the root for that request?

    Thread Starter multimediocrity

    (@multimediocrity)

    Thanks for the reply! I believe the main site and subdomains are coming from the same place. The HTACCESS file is in the public_html directory and I’m able to turn my forcing of HTTPS on and off for both the main site and subdomains. When I make a change to the HTACCESS file, both my main site and subdomains are affected, so that shows me they are both reading from that file. The subdomain must read from the root.

    I’m new to writing HTACCESS file commands so I’m a little uncertain of what to do here.

    So it sounds like your subdomains are subfolders of the root.
    I would make a .htaccess file in the subdomain folder, to force the http instead of https. But if any of the root links to a subdomain, you will have the mixture problem. If they are independent, it shouldn’t matter.

    Dion

    (@diondesigns)

    If you have a managed VPS or shared hosting, you should contact your hosting company and have them install a (free) Let’s Encrypt certificate that covers all your subdomains. If you registered your domain with your hosting company, then they can instead install a (free) Let’s Encrypt wildcard certificate.

    If you have an unmanaged VPS but have cPanel installed, free SSL certificates can also be installed through cPanel.

    Moderator Jan Dembowski

    (@jdembowski)

    Forum Moderator and Brute Squad

    Moved to Fixing WordPress, this is not a Developing with WordPress topic.

    Thread Starter multimediocrity

    (@multimediocrity)

    Dion Designs

    Thanks for the information, but I did already speak to them. We do have a VPS and they’ve added the Let’s Encrypt SSL on all my domains. The tricky thing here is the Wildcard, which they don’t provide for free.

    Joy

    I don’t see any subfolders listed for any of my subdomains. The only way they seem to be partitioned is in each section, like my uploads will have a bunch of numbered folders corresponding to each subsite’s id.

    Jan Dembowski

    Really? Ok, but this hands down seems like a Developing issue, not a Fixing issue. It’s up to you, though. You’re the moderator.

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘HTTPS on main domain, HTTP on subdomains?’ is closed to new replies.