1

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?

urok93
  • 537
  • 3
  • 7
  • 25

1 Answers1

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.

Apache docs

PassKit
  • 12,231
  • 5
  • 57
  • 75