In Mamp pro I want both the www.test.com and test.com domains to be redirected to the same folder on localhost, do I have to enter them both or is there some option to automatically apply the settings of one to the other so i don't have to enter them both?
Asked
Active
Viewed 4,527 times
1 Answers
2
Use a ServerAlias
in the virtual host config. For MAMP PRO you should be abale to just add ServerAlias test.com
to the Customized virtual host general settings
box on the Advanced Virtual Hosts Configuration
tab.
Otherwise, locate the virtual host declaration in /Applications/MAMP/conf/apache
and add it manually.
<VirtualHost *>
DocumentRoot /Applications/MAMP/htdocs/test.com/
ServerName www.test.com
ServerAlias test.com
<Directory "/Applications/MAMP/htdocs/test.com/">
Order allow,deny
allow from all
</Directory>
</VirtualHost>
You will need to restart Apache to make the configuration active.

PassKit
- 12,231
- 5
- 57
- 75
-
where do I insert that in Mamp pro? – urok93 Jan 12 '13 at 19:42
-
See updated answer, you should be able to so this the Advanced Virtual Hosts Configuration tab without touching the config files. – PassKit Jan 13 '13 at 02:43