CI Episode-3 Creating Virual Host for your website

Virtual Hosts give you the ability to “host” more than one Web site and domain on your computer. With a virtual host you can have separate local domain names for each of your Web sites: for example, http://ayzeetech.dev/ for one site and http://webwizo.dev/ for another. When you type the URL for the Virtual Host in your Web browser, the browser doesn’t go out onto the internet to find the site, but instead asks for the proper file from the Web server running on your computer. Not only does a Virtual Host let you run multiple Web sites on your computer, but it also lets you store the files for those sites anywhere on your computer and not just in the C:\XAMPP\htdocs folder.

Adding a Virtual Host is a 2-step process:

Add a new entry to your computer’s hosts file.
A hosts file can be used to point requests for a domain to a particular IP addressin other words, it lets you re-direct communications to a particular domain. In the case of a virtual host, it can tell the computer to NOT go out on the internet when you type a particular URL like http://ayzeetech.dev/, but instead look for that particular domain on your own computer.

Edit the Apache configuration file to accept Virtual Hosts and define the particular Virtual Hosts you want to setup on your computer. The first step above, merely redirects requests from a particular domain to your computer, but this step prepares the Web server on your computer for handling those requests. In this step, you not only provide the name of the Virtual Host, but also tell Apache where the files for the site are located on your computer.

see the complete Virtual Host Detail.

ayzeetech

I'm Ayaz Ahmed Mast, I am a web developer and Instructor at Al Fateem Academy. My current weapons of choice are PHP CodeIgniter, jQuery, AJAX and Laravel. Being a Developer, I help clients bring their ideas into reality. Contact me today and I would love to hear about your business.