[resolved] Multisite + SSL = 404 errors for most pages (2 posts)

  1. dbvista
    Posted 5 years ago #

    I run a multisite setup with subdirectories. Recently I set up SSL to secure the login page (using FORCE_SSL_LOGIN) and have run into a problem: only physical files in the filesystem can be accessed over https. Meaning all the other blogs in my network don't work, including the login pages on those blogs.

    So hitting the main blog works fine:


    and physical files work fine, like the main login page:


    But all other https URLs that don't physically point to a file in the filesystem produce 404 errors:

    https://myblog.example.com/sitename/wp-login.php      # Ouch!

    It's as if the WordPress "magic" that maps URLs to blogs is being completely bypassed.

    My .htaccess file is unchanged since installation:

    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    # uploaded files
    RewriteRule ^([_0-9a-zA-Z-]+/)?files/(.+) wp-includes/ms-files.php?file=$2 [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]

    Can someone suggest a way I can debug this? Or have you seen it before? The docs on FORCE_SSL_LOGIN say that it should just work when you define it in wp-config.php, but it looks like more changes are needed.

    Thanks very much.

  2. dbvista
    Posted 5 years ago #

    Solved it myself. My apache configuration was using name-based virtual hosts but only on port 80. I added the following to my httpd.conf file and all is well.

    NameVirtualHost *:443
    <VirtualHost *:443>
        ServerName myblog.example.com
        <Directory "/var/www/html">
        AllowOverride FileInfo Options

Topic Closed

This topic has been closed to new replies.

About this Topic


No tags yet.