0

I tried to set up virtual host in xampp for my website. For this I set host file like:

127.0.0.1           siteurl

I am adding code in httpd-vhosts.conf file:

<VirtualHost *:80>
      ServerAdmin webmaster@localhost.com
      DocumentRoot "C:/xampp/htdocs/foldername"
      ServerName siteurl
      <Directory />
        AllowOverride none
        Require all denied
      </Directory>
</VirtualHost>

After that put the siteurl in browser then, I got the xampp dashboard. How can I get my website by entering my siteurl. can you please help me anyone.

Teresa
  • 127
  • 2
  • 8

2 Answers2

0

You're Directory needs the absolute path to your DocumentRoot and you were closing that tag, remove the /. Also, windows requires \ instead of / in the root paths. Also I opened up your permissions a little for testing. Yours seemed very restrictive and could cause problems in getting it up and running

<VirtualHost *:80>
      ServerAdmin webmaster@localhost.com
      DocumentRoot "C:\xampp\htdocs\foldername"
      ServerName siteurl
      <Directory "C:\xampp\htdocs\foldername">
        Require all granted
        AllowOverride All  
        # AllowOverride none 
        # Require all denied
      </Directory>
</VirtualHost>

Also, when you update your hosts file, you need to clear your DNS cache which usually happens when you restart, but you can also run this command in your command window:

ipconfig /flushdns
Kinglish
  • 23,358
  • 3
  • 22
  • 43
-1

I changed my xampp version. My previous version is not supporting in my files. that's the reason. thankyou for your support

Teresa
  • 127
  • 2
  • 8