Pro sites - Subdomain does not work and https is on also subdomain. I only want https on head domain

Tested to reg a new site in the network. See below.

Problem 1: Subdomain does not work because it write out https but it should be without https. I only want https for http://www.egenhemsida.net and not for the subdomains.

https://wordpress.org/plugins/wordpress-https/

Finalizing your site...
Your payment is being processed and you should soon receive an email with your site details.

Your login details are:

Username: (removed by staff member)
Password: (remove by staff member)
Admin URL: https://design2.egenhemsida.net/wp-admin/ (also this ahrefed wrong )

If you did not receive an email please try the following:

Wait a little bit longer.
Check your spam folder just in case it ended up in there.
Make sure that your email address is correct (viktor@(removed by staff member))
If your email address is incorrect or you noticed a problem, please contact us to resolve the issue.

  • Adam Czajczyk

    Hello Viktor,

    I hope you're well today and thank you for your question!

    Before I go any further, please note: this is a public forum and it's fairly well indexed by Google and other search engines. That said, please do not ever post any sensitive data such as passwords and access credentials here. I've already removed them from your post for sake of your site's security. In case I'd need more access than the "support access" that you've granted with our WPMU DEV Dashboard plugin, I'll ask you to send them to me via private message. Thanks for understanding :slight_smile:

    As for the issue.

    Our "Pro Sites" plugin do not determine upfront whether the new site should be served over http or https connection so it's entirely up to your WP settings and/or possible configuration changes introduced by other plugins.

    Most likely the WordPress HTTPS plugin is the main culprit here as it seems to be taking over default settings. Also, it has not been updated for over 2 years now so I wouldn't put much confidence in its reliability.

    That said, my suggestion would be to disable that plugin, then make sure that all the sites (main and sub-sites) are configured to use HTTP connection (by going to "Network admin" -> "All sites" -> "Edit" option for every site) and accessible this way.

    Once this is working, it would be enough to redirect main site from http to https connection. Putting this code into your site's ".htaccess" file right below the "RewriteEngine On" line should do the trick:

    RewriteCond %{HTTP_HOST} ^www\.egenhemisda\.net [NC]
    RewriteCond %{HTTPS} off
    RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI}
    RewriteCond %{HTTP_HOST} ^egenhemisda\.net [NC]
    RewriteCond %{HTTPS} off
    RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI}

    I hope that helps!

    Best regards,
    Adam

  • Viktor

    Hi Thank you.

    I have tried this now and this make problem with pictures and stuff so think I go back to the plugin. Googled little and people say the HTTPS plugin still works.

    I think my problem is hosting setting related. Subdomains without https still go wrong (to a completely other site on the server) but I think the hosting company have done wrong when they set up this my multisite webhosting website on the server, or what you think?

    What you think the webhost have to change to fix this?

  • Adam Czajczyk

    Hello Vikotor!

    I have tried this now and this make problem with pictures and stuff so think I go back to the plugin. Googled little and people say the HTTPS plugin still works.

    Yes, it seems that HTTPS plugin does still work (though we don't know for how long it will still be). However, I hoped that getting rid of it will solve the problem of "forced https" for subdomains.

    That said, as you decided to stick to WP HTTPS plugin, that's perfectly fine. What's worrying my is that - as you say - those sub-domains go to completely different sites than they should if accessed over http connection.

    I took another look, trying to access your domain via various (including non-existing ones) sub-domains and it seemed to me that this works fine but I may be missing something here. That said it may be indeed best to make sure first that DNS is configured properly.

    The golden rule here is that all the sub-domains of your main domain (regardless whether over HTTP or HTTPS connection) should point to the root folder/main site of your install. If this is working, WordPress will take care of the rest.

    Best regards,
    Adam

  • Viktor

    Hello,

    I thinking to disable the Wordpress https plugin and use the htcaccess file like you describe but I want the wp-admin and sudomain sites for subdomains to redirect to regular http because our SSL does not support subdomain.

    All subdomains: = http://subdomainblogg.headdomain.net
    All subdomains: = http://subdomainblogg.headdomain.net/wp-admin

    Headdomain: = https://headdomain.net
    Headdomain admin can be = http://headomain.net/wp-admin Bacause the links to networks sites get wrong if wp-admin here is https://

    The code you writed:

    RewriteCond %{HTTP_HOST} ^www\.mysite\.net [NC]
    RewriteCond %{HTTPS} off
    RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI}
    RewriteCond %{HTTP_HOST} ^mysite\.net [NC]
    RewriteCond %{HTTPS} off
    RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI}

    How to custimize the code above?

  • Rupok

    Hi Viktor

    I hope you had a wonderful day.

    For customizing the code @Adam Czajczyk gave you, you can replace " .mysite " with ".yourdomain " and " .net " with ".com/.net/.info " anything that your domain has.

    Moreover if the above code isn't enough for you, you can get clear idea from this article: http://halfelf.org/2014/ssl-for-one-domain-on-multisite/

    This guy clearly showed how he set his SSL only for specific URLs. I believe it helps.

    Have a nice day. Cheers!
    Rupok

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.