Saturday, June 22, 2024

how to create virtual host in xampp?

create virtual host in xampp

Hello to all, welcome to In this post, I will tell you, how to create virtual host in xampp? Xampp is free and open source cross-platform web server solution. Xampp containing PHP, MYSQL etc.

Benefits of creating virtual host is you can easily make make urls clean and many more.

1. First you need to add the following code in C:/xampp/apache/config/extra/httpd-vhosts.config file:

    DocumentRoot "C:/xampp/htdocs/therichpost"
  ServerName therichpost.localhost

2. After it your need to add the below code in C:\Windows\System32\drivers\etc\hosts file:       therichpost.localhost #change to match your Virtual Host.

3. After this restrat your xampp server and you can open your website with "therichpost.localhost" link.

Now you can open your localhost like:
First before applying virtual host:

After applying virtual host:

 There are so many code tricks in Xampp and i will let you know all. Please do comment if you any query related to this post. Thank you.

the authortherichpost
Hello to all. Welcome to Myself Ajay Malhotra and I am freelance full stack developer. I love coding. I know WordPress, Core php, Angularjs, Angular 14, Angular 15, Angular 16, Angular 17, Bootstrap 5, Nodejs, Laravel, Codeigniter, Shopify, Squarespace, jQuery, Google Map Api, Vuejs, Reactjs, Big commerce etc.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.