WouterB
WouterB

Reputation: 235

Multiple Subdomains on Xampp

I want to start developing a site locally and later port it to the web. As I'm planning to run a Wordpress Network using Subdomains, I would need to set-up a Xampp installation that would allow me to run a subdomain install.

No idea how to do this and haven't found much info on the web either. Can someone point me in the right direction? I've seen people managing to change the URL as well. I can't seem to get past http://localhost.

Upvotes: 0

Views: 4208

Answers (2)

rgdesign
rgdesign

Reputation: 1064

You need two things first of all, and nothing related to wordpress.

Let´s supose you will use a local url like "your_test_domain.local", so:

#1 Add virtual servers on your xampp httpd-vhosts.conf (xampp\apache\conf\extra\httpd-vhosts.conf).

For example:

<VirtualHost *>
    DocumentRoot "C:\xampp\htdocs\your_site_folder"
    ServerName your_test_domain.local
    ServerAlias your_test_domain.local
    <Directory "C:\xampp\htdocs\your_site_folder">
        Order allow,deny
        Allow from all
    </Directory>
</VirtualHost>

That means, if you surf to "your_site_folder.local" you will see what´s on the "your_site_folder" folder inside xampp htdocs folder. Right?

#2 and also, you need to edit the hosts file on windows (guess you are using win), that´s on: Windows\System32\drivers\etc\, and add this line:

127.0.0.1   your_test_domain.local

Start apache to take this effect. Same thing for subdomains, you only need to create another virtualhost and another host redirection but for "sub_domain.your_test_domain.local"

So, once you got those things, you also will need some plugin to install on wordpress. I use the Domain Mapping Plugin, that will do the rest, but, that´s another story. Start there and you will learn the rest.

Hope that helps.

Upvotes: 5

Rob
Rob

Reputation: 1255

Try this link

http://www.howtoforge.com/forums/showthread.php?t=23

also watch out for xampp's root index.php file as it has a redirect in it...

Upvotes: 0

Related Questions