Multisite (single database) in subdirectories with different domain names
-
Hi,
I am new to wordpress multisite setup in subdirectories. I am running Ubuntu 16.04 with wordpress 5.1.1.
I installed it already and it is working, but I have not added my domains yet.
I have 3 sites in subdirectories and I want each of these sub sites to have its own domain name.
domain1.com (main wordpress site (wp_)
domain2.com (1st sub directory wordpress site (wp_2)
domain3.com (2nd sub directory wordpress site (wp_3)
domain4.com (3rd sub directory wordpress site (wp_3)So I want 4 different domains (domain names) to same public IP (server) and have each domain to a different sub directory website.
I already have the letsencrypt installed for the 4 domains as well.
I have been looked and looked for a solution and I have not found it yet, or I don’t understand how it works:)
So I have tried to add a domain name to one of the sites, so ones added/configured, I am not able to access it because it does not route/map correctly because of the different domain names for the URL and home directory for wp_ vs wp_2 vs wp_3 etc.Can someone please let me know if this is possible to accomplish? If so, how should it be configured? Any help is very much appreciated.
Current virtual hosts file for apache2
markus@vm-wp-16s-s1:/etc/apache2/sites-available$ cat wordpress.conf
# Alias /wp /usr/share/wordpress
# Alias /wp/wp-content /var/lib/wordpress/wp-contentServerAdmin [email protected]
ServerName domain1.com
ServerAlias https://www.domain1.com
DocumentRoot /var/www/html/wordpressAlias /wordpress /var/www/html/wordpress
Alias /wordpress/wp-content /var/www/html/wordpress/wp-content# <Directory /usr/share/wordpress>
<Directory /var/www/html/wordpress>
Options FollowSymLinks
AllowOverride Limit Options FileInfo All
DirectoryIndex index.php
Order allow,deny
Allow from all
</Directory><Directory /var/www/html/wordpress/wp-content>
Options FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>Current .htaccess file
/var/www/html/wordpress/.htaccess
RewriteEngine On
RewriteBase /wordpress/
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]Regards,
Markus
- The topic ‘Multisite (single database) in subdirectories with different domain names’ is closed to new replies.