Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I uncommented the following line in httpd.conf file.

Include /private/etc/apache2/extra/httpd-vhosts.conf

And then added the following code in httpd-vhosts.conf

<VirtualHost *:80>
  ServerName 15ive.com
  ServerAlias *.15ive.com
  DocumentRoot "/Applications/MAMP/htdocs/15five/web"
  <Directory "/Applications/MAMP/htdocs/15five/web">
    Options Indexes FollowSymLinks MultiViews
    AllowOverride All
    Order allow,deny
    Allow from all
</Directory>
  SetEnv DEV 1
  SetEnv BASEDOMAIN 15ive.com
  RewriteEngine on
  RewriteCond %{REQUEST_URI} !^(/index\.php|/images|/scripts|/js|/css|/robots\.txt|/favicon\.ico|/pma15$
  RewriteRule ^(.*)$ /index.php/$1 [L]
</VirtualHost>

And now when I open 15ive.com in my browser, I am actually seeing the document root of localhost instead of what I specified in the virtual hosts file. It seems like apache is not picking it up. Any idea where did I go wrong?

share|improve this question

3 Answers 3

Open your /etc/apache2/httpd.conf file, and go to the Include /private/etc/apache2/extra/httpd-vhosts.conf line.

Look for:

<IfDefine WEBSHARING_ON> ... </IfDefine>

which wraps around a few includes in that area, and delete those lines. If you use the GUI for apache on OSX, you could set "WEBSHARING_ON", but like me you're prob using httpd -k start.

share|improve this answer

Did you uncomment

#Include conf/extra/httpd-vhosts.conf

in your Apache httpd.conf file?

share|improve this answer

I would move the Directory directive first out and than above the VirtualHost directive.

<Directory "/Applications/MAMP/htdocs/15five/web">
    Options Indexes FollowSymLinks MultiViews
    AllowOverride All
    Order allow,deny
    Allow from all
</Directory>

<VirtualHost *:80>
  ServerName 15ive.com
  ServerAlias *.15ive.com
  DocumentRoot "/Applications/MAMP/htdocs/15five/web"
  SetEnv DEV 1
  SetEnv BASEDOMAIN 15ive.com
  RewriteEngine on
  RewriteCond %{REQUEST_URI} !^(/index\.php|/images|/scripts|/js|/css|/robots\.txt|/favicon\.ico|/pma15$
  RewriteRule ^(.*)$ /index.php/$1 [L]
</VirtualHost>
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.