Hi there!
I’m running a Multisite network and I’m still setting it up. Unfortunately I have a small problem. I can’t seem to do the following: SSL login without an error.
Let’s take these two examples, both are connected to the WordPress.com multisite:
jaco.by
ryan.boren.me (wut?)
Anyway, try adding /wp-admin to the end of those urls.
As you can see, they’re both getting redirected to their.wordpress.com – and THEN https:// gets pasted in front of the url, and then /wp-admin/ behind it.
Then, not so important, the WordPress magic happens to determine if you’re already logged in or not (and much more!).
But how do I achieve this?
As you can see in the following example, you’ll get a cert error:
Go to testmijnpagina.nl
Add /wp-admin behind it
Redirect to WARNING page =.=
Get scared while hell freezes over. <continue or exit>
If you continue: https://testpage.hostmijnpagina.nl/wp-admin/ and everything’s okay :slight_smile:
As you can see, I want to remove the warning page. To accomplish this, I need to make sure testmijnpagina.nl first goes to the port 80(80)/http site (testpage.hostmijnpagina.nl) – and then goes to the 443/https site.
I thought this should be easier as the cert should only get called at the last moment. Unfortunately, it doesn’t – the cert somehow loads before the user enters the login page. There’s not even https:// in the address bar when the warning appears!
I could create a loop in htaccess but that will only block the website from redirecting. So I think this has to be done on a PHP level.
This is what I have at the moment, my pretty .htaccess file (without the security and wpmu settings):
#1
RewriteCond %{HTTP_HOST} ^(www.)?hostmijnpagina.nl$ [NC]
RewriteRule ^/?register/(.*)$ https://signup.hostmijnpagina.nl/$1 [L,R=301]
#2
RewriteCond %{HTTP_HOST} ^(www.)?hostmijnpagina.nl$ [NC]
RewriteRule ^/?wp-signup(.*)$ https://signup.hostmijnpagina.nl/wp-signup [L,R=301]
#3
RewriteCond %{HTTPS} off
RewriteCond %{HTTP_HOST} ^(dashboard|wiki|registreer|signup|themas|login|www). [NC]
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R,L]
#4
RewriteCond %{HTTPS} off
RewriteCond %{HTTP_HOST} ^hostmijnpagina.nl [NC]
RewriteRule ^(.*)$ https://hostmijnpagina.nl/$1 [R,L]
#5
RewriteCond %{HTTPS} off
RewriteCond %{THE_REQUEST} ^.?hostmijnpagina.nl/wp-(admin|login|register)$ [NC]
RewriteRule !^/wp-(admin|login|register)(.*) https://%{SERVER_NAME}%{REQUEST_URI} [L]
The first two rule blocks are for registration at subdomain level. The 3rd block is to force https:// on all my domains.
The 4th block is to force https on the main domain.
And the 5th block is the “wp-admin/login/register” https:// force.
It all works, but the 5th block (in conjunction with the 4th maybe??( Gives me an error.
test/testpage.hostmijnpagina.nl goes to http if the 5th block is available, it goes to https:// if the 5th block is removed. I think this is block 4’s fault.
I’m kind of puzzled, maybe I’ve been on this subject for too long.
I do not want to force https on every subdomain. Only on the ones I manage. I do want to force ssl logins and admin management.
Any help would be greatly appreciated :slight_smile: Thanks!