Subdomain (Virtual Host) On Localhost


/ Published in: Apache
Save to your folder(s)



Copy this code and paste it in your HTML
  1. apache httpd.conf:
  2. <VirtualHost *:80>
  3. DocumentRoot "<absolute path to site web root>"
  4. ServerName <subdomain>.local
  5.  
  6. SetEnv APPLICATION_ENV development
  7.  
  8. <Directory "<absolute path to site web root>">
  9. Options Indexes MultiViews FollowSymLinks
  10. AllowOverride All
  11. Order allow,deny
  12. Allow from all
  13. </Directory>
  14. </VirtualHost>
  15.  
  16. windows host file:
  17. C:\WINNT\system32\drivers\etc\hosts
  18. C:\Windows\system32\drivers\etc\hosts
  19. >
  20. > 127.0.0.1 <subdomain>.localhost

URL: http://apptools.com/phptools/virtualhost.php

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.