New Feature: Earn 12 Badges

Bild

Collect up to 12 exclusive badges by sharing your plugin collections and engaging with the community.

See all Badges
SSL Subdomain for Multisite
SSL Subdomain for Multisite

by Peter Upfold

Description

Ensures logins are always done via SSL on a subdomain of the master domain, but that access to custom domains are always done over HTTP, to avoid certificate errors. For WordPress Multisite.

WordPress’ built-in FORCE_SSL_LOGIN and FORCE_SSL_ADMIN directives in wp-config.php work great, but are too restrictive in situations where you have custom domains — custom domains for which you cannot have SSL certificates. For sites on custom domains, we need to make sure that the login and admin access happens over the subdomain, which can be properly served over HTTPS.

What this Plugin does (incorporating Foolish Assumptions)

or, a readme you should read before implementing this plugin on your site.

This plugin filters the login, logout, home and admin URLs that WordPress uses to generate its internal links.

Why do we do this?

The Scenario

We have a WordPress Multisite network. Let’s call it mynetwork.com. We bought a fancy SSL wildcard certificate so we can offer *.mynetwork.com over a secure connection.

We’d very much like to use this secure connection for all logins, and for all admin access.

We also allow sites on this network to use a custom domain — like demo-site.com. We might be using WPMU Domain Mapping to achieve this. These sites have two domains, then — demo-site.com and demo-site.mynetwork.com.

If we switch on FORCE_SSL_LOGIN or FORCE_SSL_ADMIN, we have a problem. When users go to https://demo-site.com/wp-login.php, they get a certificate error. We have a wildcard certificate for *.mynetwork.com, but we can’t possibly have a valid SSL certificate installed for every custom domain!

Instead, we want to force all login pages and admin pages to be:

https://demo-site.mynetwork.com/wp-admin/… 

We want all regular access to be:

http://demo-site.com/… 

This plugin facilitates that — rewriting the wp-login (including logout) and wp-admin URLs to the first example, and rewriting all the others to the second style.

Foolish Assumptions

This plugin makes some (foolish) assumptions about your multisite network. You must make sure that these assumptions are true for your site, or you will find that this plugin may have unintended consequences and break things that are difficult to fix without manually disabling the plugin.

  1. Your subdomains are in the format: a.b

    where a is, for example: demo-site. b is, for example: mynetwork.com. a must be a single domain component. (a can’t be, for example: demo.site)

  2. Your wildcard certificate is configured properly for:

    • *.mynetwork.com
    • your network site URL

    So if your network site URL is www.mynetwork.com, your wildcard cert will be fine. If it is just mynetwork.com, you will need another cert to avoid errors when you go to https://mynetwork.com/wp-admin.)

  3. Your site already has the custom domains working.

    • I suggest the excellent WPMU Domain Mapping for this.

      • Your web server also needs to be set up to handle hosting a wildcard name virtual host. All of this is really part of the WPMU Domain Mapping set up, and not the set up for this plugin. I’m just, you know, mentioning it.
  4. You have the FORCE_SSL_LOGIN setting in wp-config.php true.

  5. You have the FORCE_SSL_ADMIN setting in wp-config.php false. We’ll handle that — WordPress’ forcing of SSL admins will conflict with this plugin.

All texts and images on this product page are protected by copyright and are the property of the author Peter Upfold. You will be redirected to the retailer to download the plugin. We act solely as a search engine for plugins and are not affiliated with the retailer or Peter Upfold.

Tags

Free Plugin

1.0
1 Reviews
Last Update
14 years ago
All trademarks, logos and brand names are the property of their respective owners. All company, product and service names used in this website are for identification purposes only. The WordPress® trademark is the intellectual property of the WordPress Foundation

Collections

SEO Plugins

  • 6 Plugins
  • 6 Views
Yoast SEO
All in One SEO – Powerful SEO Plugin to Boost SEO Rankings & Increase Traffic
Rank Math SEO – AI SEO Tools to Dominate SEO Rankings
WP Fastest Cache

Page Builder

  • 1 Plugin
  • 13 Views
Page Builder: Pagelayer – Drag and Drop website builder

payment methodes per

  • 1 Plugin
  • 6 Views
Payment Gateway Based Fees and Discounts for WooCommerce

SEO

  • 1 Plugin
  • 7 Views
Yoast SEO

Wordpress

  • 13 Plugins
  • 7 Views
Really Simple Security – Simple and Performant Security (formerly Really Simple SSL)
Forminator Forms – Contact Form, Payment Form & Custom Form Builder
Yoast SEO
Site Kit by Google – Analytics, Search Console, AdSense, Speed

slider

  • 1 Plugin
  • 5 Views
Photo Gallery, Sliders, Proofing and Themes – NextGEN Gallery

Yeer

  • 1 Plugin
  • 6 Views
Autoptimize

Optimisation Plugins

  • 1 Plugin
  • 13 Views
Smush Image Optimization – Optimize Images | Compress & Lazy Load Images | Convert WebP | Image CDN

Best Speed Plugins

  • 4 Plugins
  • 6 Views
LiteSpeed Cache
WP Fastest Cache
WP-Optimize – Cache, Compress images, Minify & Clean database to boost page speed & performance
10Web Booster – Website speed optimization, Cache & Page Speed optimizer

Must-Have Plugins

  • 9 Plugins
  • 130 Views
Elementor Website Builder – More than Just a Page Builder
Yoast SEO
All-in-One WP Migration and Backup
Wordfence Security – Firewall, Malware Scan, and Login Security

Best Security Plugins

  • 3 Plugins
  • 5 Views
Jetpack – WP Security, Backup, Speed, & Growth
Wordfence Security – Firewall, Malware Scan, and Login Security
Solid Security – Password, Two Factor Authentication, and Brute Force Protection

Best Member Plugins

  • 5 Plugins
  • 6 Views
Paid Memberships Pro – Content Restriction, User Registration, & Paid Subscriptions
Ultimate Membership Pro - WordPress Membership Plugin
Ultimate Member – User Profile, Registration, Login, Member Directory, Content Restriction & Membership Plugin
Paid Membership Plugin, Ecommerce, User Registration Form, Login Form, User Profile & Restrict Content – ProfilePress

Best Recruitment Website Plugins

  • 3 Plugins
  • 6 Views
WP Job Openings – Job Listing, Career Page and Recruitment Plugin
Smush Image Optimization – Optimize Images | Compress & Lazy Load Images | Convert WebP | Image CDN
WP Job Manager

Cookie Plugins

  • 3 Plugins
  • 14 Views
CookieYes – Cookie Banner for Cookie Consent (Easy to setup GDPR/CCPA Compliant Cookie Notice)
Autoptimize
Complianz – GDPR/CCPA Cookie Consent

Donation Plugins

  • 2 Plugins
  • 25 Views
Charitable – Donation Plugin for WordPress – Fundraising with Recurring Donations & More
GiveWP – Donation Plugin and Fundraising Platform