[wp-hackers] MultiSite Localhost subdomain redirect issue

Duncan O'Neill webservices at slingshot.co.nz
Fri Jul 26 19:34:50 UTC 2013


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 also posted this on the WordPress forums, but received no replies.

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;

( xp-home is the name of my local machine )

============================
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,

-- 
Duncan O'Neill
http://urbanlegendweb.co.nz/
mob:+64 27 385 8086
skype: maxwell_s


More information about the wp-hackers mailing list