Multisite Subdomains result in 403 Forbidden

So I have setup multisite as per the WordPress website page: https://codex.wordpress.org/Create_A_Network

I'm using the latest WordPress 4.8.

Setup

  • example.com
  • sub.example.com

All requests for the subdomain for the dashboard and the site give a

403 - forbidden You don't have permission to access / on this server.

.htaccess

    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]

    # add a trailing slash to /wp-admin
    RewriteRule ^wp-admin$ wp-admin/ [R=301,L]

    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule ^ - [L]
    RewriteRule ^(wp-(content|admin|includes).*) $1 [L]
    RewriteRule ^(.*\.php)$ $1 [L]
    RewriteRule . index.php [L]

The permissions are as WordPress - strict, which work normally:

sudo find . -type d -exec chmod -R 755 {} \;; sudo find . -type f -exec chmod 644 {} \;; sudo chmod 444 wp-config.php .htaccess ; sudo chmod -R 755 wp-content ; sudo chmod -R 775 wp-content/uploads/ ; sudo chgrp -R admin .  sudo chown -R admin:www-data wp-content

I have setup subdomains on my server and pointed the document roots to the main website example.com.

I've searched for hours as to why this isn't working but can't seem to find a solution... can anyone help?

Topic htaccess multisite Wordpress

Category Web


https://wordpress.stackexchange.com/a/135740/141068

I used the above link to correct my issue.

You can check your wildcard subdomain to be pointing to the same folder as that of the main Wordpress installation folder.

For example, if example.com is installed on public_html/example.com, *.example.com should be added to the same public_html/example.com.

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.