How to add sub domains with xampp
Use bellow steps to used sub-domain with xampp.
1. Open your xmapp httpd.conf file.
ex : D:\xampp\apache\conf \httpd.conf
{your xampp location dir}\apache\conf \httpd.conf
2. In this example I used two sub-domains.
# SUBDOMAIN 1
<VirtualHost *:89>
DocumentRoot "D:\xampp\htdocs\sub"
ServerName asubdomain.localhost
<Directory "D:\xampp\htdocs\sub">
Options FollowSymLinks Indexes
AllowOverride All
Order deny,allow
allow from All
</Directory>
</VirtualHost>
# SUBDOMAIN 2
<VirtualHost *:89>
DocumentRoot "D:\xampp\htdocs\sub2"
ServerName bsubdomain.localhost
<Directory "D:\xampp\htdocs\sub2">
Options FollowSymLinks Indexes
AllowOverride All
Order deny,allow
allow from All
</Directory>
</VirtualHost>
3. Then go to C:\windows\system32\drivers\etc and open "host" file in notepad ( notepad should have administrator privilege to save this file.)
Add this content to it and save.
127.0.0.1 asubdomain.localhost
127.0.0.1 bsubdomain.localhost
4. Restart the xampp server.
That's all....
1. Open your xmapp httpd.conf file.
ex : D:\xampp\apache\conf \httpd.conf
{your xampp location dir}\apache\conf \httpd.conf
2. In this example I used two sub-domains.
# SUBDOMAIN 1
<VirtualHost *:89>
DocumentRoot "D:\xampp\htdocs\sub"
ServerName asubdomain.localhost
<Directory "D:\xampp\htdocs\sub">
Options FollowSymLinks Indexes
AllowOverride All
Order deny,allow
allow from All
</Directory>
</VirtualHost>
# SUBDOMAIN 2
<VirtualHost *:89>
DocumentRoot "D:\xampp\htdocs\sub2"
ServerName bsubdomain.localhost
<Directory "D:\xampp\htdocs\sub2">
Options FollowSymLinks Indexes
AllowOverride All
Order deny,allow
allow from All
</Directory>
</VirtualHost>
3. Then go to C:\windows\system32\drivers\etc and open "host" file in notepad ( notepad should have administrator privilege to save this file.)
Add this content to it and save.
127.0.0.1 asubdomain.localhost
127.0.0.1 bsubdomain.localhost
4. Restart the xampp server.
That's all....
Comments
Post a Comment