Title: wordpress.com-like setup SSL problem
Last modified: August 21, 2016

---

# wordpress.com-like setup SSL problem

 *  Resolved [meglio](https://wordpress.org/support/users/meglio/)
 * (@meglio)
 * [12 years, 10 months ago](https://wordpress.org/support/topic/wordpresscom-like-setup-ssl-problem/)
 * Hi Ron.
 * First at all, here are our settings for the plugin:
 * Domain Options
    + Remote Login + Permanent redirect (better for your blogger’s
   pagerank) – User domain mapping page + Redirect administration pages to site’s
   original domain – Disable primary domain check.
 * Our setup is simple:
 * * We use define(‘FORCE_SSL_ADMIN’, true);
 * * We follow the same approach as wordpress.com does regarding SSL certificate.
   We have one wildcard certificate *.example.com for our top domain where the WP
   network is insatlled (e.g. example.com).
 * What we are trying to achieve: we want all user’s admin areas and logins to happen
   under HTTPS, hence those settings mentioned above. We want front part of mapped
   domains (for children blogs) to be on HTTP (no ssl).
 * What problem we are experiencing: everything is excellent except one thing. If
   our client logins to their admin area and then navigates to the front page, the
   links in the top admin bar are all for top-domain.com/wp-admin/etc.
 * When clicking to such a link, I expect your plugin to redirect – and in fact 
   it does it right. But before it can redirect, browser tries to open their top-
   domain.com/wp-admin/etc under HTTPS and our certificate does not cover all mapped
   domains, of course. So a terrible message like this is shown to the client: [http://img191.imageshack.us/img191/9832/x9x.png](http://img191.imageshack.us/img191/9832/x9x.png)
 * Is there a way to configure your plugin in a way that at all times all admin 
   links will always use sub-domain notation and never mapped-domain notation?
 * So the goal is to let client freely navigate between his admin pages (sub-domain
   links) and front pages (mapped top level domain), without their browser even 
   trying to open admin pages under a top level domain.
 * In other words, I would like to have all navigation links in their admin panel
   to link to the sub-domain urls.
 * Btw, if I’m authorized super-admin then the links are correct already, eg:
 * My Sites -> Some Child Site -> Dashboard: this links to sub-domain notation.
 * But after navigating to the child site mapped domain, all links in the admin 
   dropdown menu (the black top bar) do not use sub-domain notation anymore.
 * Any ideas?
 * Regards,
    Anton
 * [http://wordpress.org/extend/plugins/wordpress-mu-domain-mapping/](http://wordpress.org/extend/plugins/wordpress-mu-domain-mapping/)

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

 *  Plugin Author [Ron Rennick](https://wordpress.org/support/users/wpmuguru/)
 * (@wpmuguru)
 * [12 years, 10 months ago](https://wordpress.org/support/topic/wordpresscom-like-setup-ssl-problem/#post-3935939)
 * If you turn off remote login then the toolbar won’t be shown on the front end.
   The remote login setting is essentially enabling the mapped domain admin links.
 *  Thread Starter [meglio](https://wordpress.org/support/users/meglio/)
 * (@meglio)
 * [12 years, 10 months ago](https://wordpress.org/support/topic/wordpresscom-like-setup-ssl-problem/#post-3935988)
 * Thanks, Ron.
    I have turned off “remote login”. But all items in the menu at 
   the top of children websites still link to the mapped domain and not sub-domain:
   [http://img834.imageshack.us/img834/3462/4of.png](http://img834.imageshack.us/img834/3462/4of.png)
 *  Thread Starter [meglio](https://wordpress.org/support/users/meglio/)
 * (@meglio)
 * [12 years, 10 months ago](https://wordpress.org/support/topic/wordpresscom-like-setup-ssl-problem/#post-3936001)
 * Oh, Ron, and also it does not immediately redirect
    sub.network.com/wp-login.
   php to sub-network.com/wp-login.php
 * It only redirects after the first login attempt.
 *  Thread Starter [meglio](https://wordpress.org/support/users/meglio/)
 * (@meglio)
 * [12 years, 10 months ago](https://wordpress.org/support/topic/wordpresscom-like-setup-ssl-problem/#post-3936011)
 * Okay, I was able to solve the “early redirect” problem with an additional small
   plugin:
 *     ```
       /* Redirect all administration and login to sub-domains  */
       function datainserter_wp_redirect($location, $status = 'not interesting')
       {
       	if (!force_ssl_admin() || is_ssl())
       		return $location;
   
       	if (!function_exists('get_original_url'))
       		return $location;
   
       	if (strpos($_SERVER['REQUEST_URI'], 'wp-login.php') === false
       		&& strpos($_SERVER['REQUEST_URI'], 'wp-admin') === false)
       		return $location;
   
       	$originalHost = parse_url(get_original_url( 'siteurl' ), PHP_URL_HOST);
       	$locationHost = parse_url($location, PHP_URL_HOST);
       	$location = str_ireplace($locationHost, $originalHost, $location);
       	return $location;
       }
   
       add_filter('wp_redirect', 'datainserter_wp_redirect');
       ```
   
 *  Plugin Author [Ron Rennick](https://wordpress.org/support/users/wpmuguru/)
 * (@wpmuguru)
 * [12 years, 10 months ago](https://wordpress.org/support/topic/wordpresscom-like-setup-ssl-problem/#post-3936068)
 * Glad you found a solution.

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

The topic ‘wordpress.com-like setup SSL problem’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/wordpress-mu-domain-mapping.svg)
 * [WordPress MU Domain Mapping](https://wordpress.org/plugins/wordpress-mu-domain-mapping/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wordpress-mu-domain-mapping/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wordpress-mu-domain-mapping/)
 * [Active Topics](https://wordpress.org/support/plugin/wordpress-mu-domain-mapping/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wordpress-mu-domain-mapping/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wordpress-mu-domain-mapping/reviews/)

## Tags

 * [FORCE_SSL_ADMIN](https://wordpress.org/support/topic-tag/force_ssl_admin/)
 * [HTTPS](https://wordpress.org/support/topic-tag/https/)
 * [SSL](https://wordpress.org/support/topic-tag/ssl/)

 * 5 replies
 * 2 participants
 * Last reply from: [Ron Rennick](https://wordpress.org/support/users/wpmuguru/)
 * Last activity: [12 years, 10 months ago](https://wordpress.org/support/topic/wordpresscom-like-setup-ssl-problem/#post-3936068)
 * Status: resolved