- b2evolution CMS User Manual
- Installation / Upgrade
- Advanced Setup
- Multi-Domain Setup
- Setting up a multidomain test environment
Setting up a multidomain test environment
This page explains how to test a Multi-domain setup on a local test/dev machine.
In order to test b2evo on multiple domains all from the development machine, the easiest way is to set up some fake domains for use in the test URLS.
Open the hosts
file with a text editor.
- On Linux and Mac OS X, this is
/etc/hosts
. Because the file may be protected, you mat need to type a command like this in your Terminal:sudo nano /private/etc/hosts
- On Windows XP, this is
C:\WINDOWS\system32\drivers\etc\hosts
. You should be able to open the file with Notepad.
This file is where localhost is defined. Like this:
127.0.0.1 localhost
Add the following lines:
127.0.0.1 b2test.loc
127.0.0.1 www.b2test.loc
127.0.0.1 a.b2test.loc
127.0.0.1 b.b2test.loc
127.0.0.1 photos.b2test.loc
127.0.0.1 forums.b2test.loc
Calling these domains in the URL field of your browser will do the same as calling localhost
, except the cookies of these domains won’t be shared with localhost…
.loc
instead of .local
, since .local
may trigger some other protocols like Bonjour.Note: a tool like MAMP PRO can automatically configure your hosts
fiel through an UI.
Once your hosts
file is configured, you need to tie each of your collections to a specific domain from the above. You can do this in the Collection Base URL Panel by using the "Sub-domain" or "Absolute URL" option.
See also: Using Multiple Domains