Multisite on Localhost with subdomains redirect
-
Hi all,
I know this is a well-chewed over topic, but despite trawling forums over days, I haven’t been able to find a topic which gives me an answer.
I’ve set up multisite on localhost on Windows using XAMPP.
The problem is a redirect loop when I try to login to my sub-domain dashboards. I can see the test sites themselves at test.xp-home, and test2.xp-home, etc. I can login to the main dashboard at xp-home.
Up until this, I’d just been doing separate installs for each build, and adding the subdomain to httpd-vhosts.conf, and editing my hosts file. That’s worked fine, but I’m trying to streamline things so that I can manage plugins and themes centrally.
This is a sample of my hosts file;
127.0.0.1 localhost
.
127.0.0.1 xp-home
.
.
127.0.0.1 test.xp-home
127.0.0.1 test2.xp-home
This is my .htaccess file under the web root;
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)$ wp/$1 [L]
RewriteRule . index.php [L]This is a sample of my vhosts file;
<VirtualHost *:80>
DocumentRoot "C:/Users/admin/Documents/web"
ServerName xp-home
#ServerAlias xp-home *.xp-home
<Directory "C:/Users/admin/Documents/web">
AllowOverride All
Options +MultiViews +FollowSymLinks
</Directory>
ErrorLog logs/error.log
CustomLog logs/access.log combined
</VirtualHost>
and at the bottom….
<VirtualHost *:80>
DocumentRoot "C:/Users/admin/Documents/web"
ServerAlias *.xp-home
ErrorLog logs/error.log
CustomLog logs/access.log combined
</VirtualHost>
Can someone please point out what I’m doing wrong here?
Many thanks in advance,
- The topic ‘Multisite on Localhost with subdomains redirect’ is closed to new replies.