php describes how to configure virtual directories under windows

  • 2020-06-22 23:59:36
  • OfStack

First open the httpd. conf file under conf directory of Apache and add the following code at the end:

<VirtualHost *:80>
 ServerName www.mydemo.com
 DocumentRoot "D:/mydemo"
<Directory "D:/mydemo"> 
 Options FollowSymLinks IncludesNOEXEC Indexes
 DirectoryIndex index.html index.htm default.htm index.php default.php index.cgi default.cgi index.pl default.pl index.shtml
 AllowOverride Options FileInfo 
 Order Deny,Allow 
 Allow from all 
</Directory>
</VirtualHost>

And then to C: - > Windows- > System32- > drivers- > etc directory, open the hosts file.
Add the following code at the end:

127.0.0.1 www.mydemo.com

Then create the D: \mydemo directory
Then restart the apache server for 1 time.
Type www.mydemo.com in the browser to see

Related articles: