Hello Advanced WP'ers,
I have a WordPress multisite network which does not run off the root of the domain, but is a path-based installation (not sub-domain) which uses the directory "/clubs/".
Example site URL may be; www.teamwebsites.co.uk/clubs/sitename
I am using the WPultimo plugin (an excellent one at that) which deals with domain mapping. However, when mapping the domain correctly, the only page which appears (with a standard .htaccess with the rewrite base set to "/clubs/") is the homepage - all other pages appear with a 500 Internal Server error. My host is Dreamhost.
Therefore I am trying to ensure both the mapped domain (if applicable) and standard WP subsite URL of each site correctly display, and so that all pages and posts on the mapped domain version do not display a 500 error. I have checked with the plugin author of wpultimo but he has exhausted all of his knowledge on this subject, as he is more of a design than server wizard.
The following is my .htaccess file as it currently stands. Note that the mapped domains work absolutely fine but the standard WP subsite URLs do not - examples being www.teamwebsites.co.uk/clubs/prdc, where the actual site does not even display due to the htaccess....
==> https://pastebin.com/raw/wYzEJ9kF <==
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
#RewriteCond %{HTTP_HOST} =teamwebsites.co.uk
#RewriteRule ^([_0-9a-zA-Z-]+/)+(wp-(content|admin|includes).*) clubs/$2 [L]
# RewriteBase equivalent - for tree.mydom.us/twig/
RewriteCond %{HTTP_HOST} ===teamwebsites.co.uk
RewriteRule . - [E=REWRITEBASE:/clubs/]
RewriteCond %{HTTP_HOST} !=teamwebsites.co.uk
RewriteRule . - [E=REWRITEBASE:/]
RewriteRule ^index\.php$ - [L]
# add a trailing slash to /wp-admin
RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ %{ENV:REWRITEBASE}$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).*) %{ENV:REWRITEBASE}$2 [L]
RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ %{ENV:REWRITEBASE}$2 [L]
RewriteRule . %{ENV:REWRITEBASE}index.php [L]
</IfModule>
# END WordPress
NOTE: I must still have the /clubs/ used as the multisite directory.
I think the confusion from the server is where mapped domains do not include the "/clubs/" as a suffix between the mapped domain itself and what follows as the post/page URL.
Please, if anyone has the solution to this, I would greatly appreciate it. After 3/4 hours of staring and trying to - along with the plugin author - change the code of the .htaccess, it's becoming ever so tedious!!