Hello there!
This is my first post, so I want to start with a big thank-you to @ben and team for the wonderful work with Trellis and Bedrock. In the past 2 weeks that I have spent hacking with both Trellis and Bedrock, I have learnt so much new stuff about Wordpress and Ansible. Awesome work guys!
Now for my issue. I seem to have hit against a wall with something I’m trying to do, and have already spent last couple of days troubleshooting and reading through this forum and elsewhere.
I’m trying to install Bedrock (I’ve synced with latest Git) with Multisite using sub-directories. I’m using Apache because my host would not support Nginx. Here’s my URL configuration:
www.mydomain.com - Root site
www.mydomain.com/us - Sub-site #1
www.mydomain.com/ca - Sub-site #2
I have not been able to get my .htaccess configuration to work properly, despite much trying. I’m close to giving up on Bedrock, even though I love it so much already.
The problem is with the fact that Wordpress is installed in a sub-directory with Bedrock (i.e. web/wp), and that doesn’t seem to go well with Multisite setup that uses subdirectories. Here’s my current .htaccess file:
# BEGIN WordPress
<IfModule mod_rewrite.c>
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).*) /current/web/wp/$1 [L]
RewriteRule ^[_0-9a-zA-Z-]+/(.*\.php)$ /current/web/wp/$1 [L]
RewriteRule ^(/)?$ current/web/index.php [L]
RewriteRule . index.php [L]
</IfModule>
# END WordPress
My wordpress_sites.yml configuration follows all the docs closely. Here’s a portion of the configuration:
multisite:
enabled: true
subdomains: false
ssl:
enabled: false
provider: letsencrypt
cache:
enabled: false
env:
domain_current_site: www.mydomain.com
wp_home: http://www.mydomain.com
wp_siteurl: http://www.mydomain.com/wp
(I have of-course replaced my real domain with www.mydomain.com
since I don’t want my domain to be known publicly and discovered by search engines.)
Thanks in advance.
Best,
Sac