define('DISALLOW_FILE_EDIT', true);{"id":553,"date":"2012-07-24T09:50:12","date_gmt":"2012-07-24T14:50:12","guid":{"rendered":"http:\/\/www.unfocus.com\/?p=553"},"modified":"2013-09-10T00:23:48","modified_gmt":"2013-09-10T04:23:48","slug":"multiple-localhost-sites","status":"publish","type":"post","link":"http:\/\/www.unfocus.com\/2012\/07\/24\/multiple-localhost-sites\/","title":{"rendered":"Multiple LocalHost Sites"},"content":{"rendered":"

I’ve got XAMPP installed on a Windows 7 machine. I wanted a way to test multiple sites locally.<\/p>\n

Set up the local host file<\/h3>\n

In your host file, add (replace with the domains you want):<\/p>\n

[code]127.0.0.1\u00a0\u00a0 \u00a0sub.domain.com.dev
\n127.0.0.1\u00a0\u00a0 \u00a0www.example.com.dev
\n127.0.0.1\u00a0\u00a0 \u00a0www.unfocus.com.dev[\/code]<\/p>\n

UPDATE: Thanks to xip.io<\/a> the host file edits are optional if you use the style www.example.com.127.0.0.1.xip.io (replace 127.0.0.1 with your actual IP address). This is compatible with Adobe’s Edge Inspect<\/a>.<\/p>\n

Set up XAMPP config files<\/h3>\n

In \\xampp\\apache\\conf\\httpd.conf uncomment the following at about line 140:<\/p>\n

[code]LoadModule vhost_alias_module modules\/mod_vhost_alias.so[\/code]<\/p>\n

I’ve used the folder structure of “\\xampp\\htdocs\\www.example.com\\web\\content\\files.php” (for example) and the following config will find the folder with the exact name in the url.<\/p>\n

In \\xampp\\apache\\conf\\extra\\httpd-vhosts.conf:<\/p>\n

[hoops name=\"config\"]<\/pre>\n

Fix DOCUMENT_ROOT<\/h3>\n

If you are having issues with DOCUMENT_ROOT, create setdocroot.php at “\\xampp\\” and put the following in it:<\/p>\n

[hoops name=\"fix\"]<\/pre>\n

References:
\n
https:\/\/issues.apache.org\/bugzilla\/show_bug.cgi?id=26052#c27<\/a>
\n
http:\/\/stackoverflow.com\/questions\/138162\/wildcards-in-a-hosts-file<\/a>
\n
http:\/\/postpostmodern.com\/instructional\/a-smarter-mamp\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"

I’ve got XAMPP installed on a Windows 7 machine. I wanted a way to test multiple sites locally. Set up the local host file In your host file, add (replace with the domains you want): [code]127.0.0.1\u00a0\u00a0 \u00a0sub.domain.com.dev 127.0.0.1\u00a0\u00a0 \u00a0www.example.com.dev 127.0.0.1\u00a0\u00a0 \u00a0www.unfocus.com.dev[\/code] UPDATE: Thanks to xip.io the host file edits are optional if you use the … Continue reading “Multiple LocalHost Sites”<\/span><\/a><\/p>\n","protected":false},"author":1797,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[22,37],"tags":[177],"_links":{"self":[{"href":"http:\/\/www.unfocus.com\/wp-json\/wp\/v2\/posts\/553"}],"collection":[{"href":"http:\/\/www.unfocus.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.unfocus.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.unfocus.com\/wp-json\/wp\/v2\/users\/1797"}],"replies":[{"embeddable":true,"href":"http:\/\/www.unfocus.com\/wp-json\/wp\/v2\/comments?post=553"}],"version-history":[{"count":61,"href":"http:\/\/www.unfocus.com\/wp-json\/wp\/v2\/posts\/553\/revisions"}],"predecessor-version":[{"id":4324,"href":"http:\/\/www.unfocus.com\/wp-json\/wp\/v2\/posts\/553\/revisions\/4324"}],"wp:attachment":[{"href":"http:\/\/www.unfocus.com\/wp-json\/wp\/v2\/media?parent=553"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.unfocus.com\/wp-json\/wp\/v2\/categories?post=553"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.unfocus.com\/wp-json\/wp\/v2\/tags?post=553"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}