• mauridoom

    (@mauridoom)


    Hi everyone out there ,

    I thinks its the first time i post a question here, most of the time i figure it out by myself but this time something seems to have changed in the wordpress multisite install and options.

    I created my network like this:

    https://mainsite.com

    and i have created 2 sub folder sites

    https://mainsite.com/en
    https://mainsite.com/fr

    I activated ssl in the wp-config.php
    I can change both sub sites url’s to ssl but for some reason on the main site the url option is grey, and i cannot edit it.

    only admin area is ssl on main site forced in config file.
    If i type the url with https://mainsite.com its ok but, it won’t redirect itself from http to https like it should work.
    It seems wordpress has changed the behaviour, options in a multisite network for ssl.

    Tutorials on the web are not up to date with latest worpdress updates and functions.

    Could someone help me figure this out ?

    thanks

    • This topic was modified 6 years ago by mauridoom.
Viewing 3 replies - 1 through 3 (of 3 total)
  • Eric Amundson

    (@sewmyheadon)

    Hi @mauridoom,

    There are several ways to deal with this but one of the easiest would be to use a plugin like WordPress HTTPS to force HTTPS on the main site.

    Also, some hosts provide plugins or tools to force HTTPS.

    You can also make some URL changes directly in the database like what you see in this article.

    If you’re hosted on an account that runs Apache for their web server, you may be able to add a snippet to your .htaccess to redirect folks from the insecure to the secure domain:

    # BEGIN HTTPS Redirect
    <IfModule mod_rewrite.c>
      RewriteEngine On
      RewriteCond %{HTTP_HOST} ^old.com$ [OR]
      RewriteCond %{HTTP_HOST} ^www.old.com$
      RewriteRule (.*)$ https://www.new.com/$1 [R=301,L]
    </IfModule>
    # END HTTPS Redirect

    I hope that helps!

    Thread Starter mauridoom

    (@mauridoom)

    Hi @sewmyheadon
    Thanks for your reply !
    I will save your .htaccess settings as last recourse.
    I wanted to know why in the wordpress multisite
    settings –> My sites –> Main Site Settings –>
    The website url is grey, cannot edit it to add secure ‘S’
    While i can on the other sites in the network.
    Also i don’t have the domain maping option in the network dashboard,
    like i saw in some tutorials on the web. Seems wordpress latest updates
    changed the network setup a little bit.

    How can i add your code or combine with the already multisite code i have in the .htaccess ?

    My .htaccess:

    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    
    # add a trailing slash to /wp-admin
    RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]
    
    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule ^ - [L]
    RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) $2 [L]
    RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L]
    RewriteRule . index.php [L]

    This is my config settings:

    define('WP_HOME','https://mysite.com');
    define('WP_SITEURL','https://mysite.com'); 
    define('WP_DEBUG', false);
    define('MULTISITE', true);
    define('SUBDOMAIN_INSTALL', false);
    define('DOMAIN_CURRENT_SITE', 'mysite.com');
    define('PATH_CURRENT_SITE', '/');
    define('SITE_ID_CURRENT_SITE', 1);
    define('BLOG_ID_CURRENT_SITE', 1);
    define('FORCE_SSL_ADMIN', true);
    
    /* Multisite */
    define( 'WP_ALLOW_MULTISITE', true );
    define('COOKIE_DOMAIN', $_SERVER['HTTP_HOST']);

    also where is the url settings of the mainsite in the network stored ?

    Thanks in advance to anyone who could explain, help me

    guillermovargasquisoboni

    (@guillermovargasquisoboni)

    Hello Mauridoom,

    I have the same question, I just activates Let’s encrypt certificate on my network and I am preparing to redirect http to https. So I wonder if .htaccess needs special settings in a wordpress multisite installation. There is no information about this on general documentation. Maybe it can helps if we can share some ideas between us.

    I can tell you that my .htaccess looks exactly as yours, but on wp-config.php have some differences: I don’t have YET any definition for WP_HOME and WP_SITEURL; the option for subdomains is activated; and finally, I don’t have any condition for cookies…

    Concerning the admin options, we are on the same situation: I cannot modify url on network’s main site, but I can do it for all subsites. I suppose that this is something related to the definition of the network itself, specifically when you declare the current site: define(‘DOMAIN_CURRENT_SITE’, ‘mydomain.org’);

    On wordpress documentation (https://codex.www.ads-software.com/Changing_The_Site_URL), I read that after defining WP_HOME or WP_SITEURL you “won’t be able to edit them on the General settings page anymore”. I suppose that this is also happening after defining DOMAIN_CURRENT_SITE, because I don’t have use the first.

    Finally, concerning the “domain mapping option”, what I understand is that we are using the homemade function when we are able to edit urls from the network’s admin screen. So probably the menu options that you are looking for are related to one of the plugins that can create this function on ancient wordpress installations.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Multisite Sub Folders Cannot Activate SLL on main site’ is closed to new replies.