Categories

Sunday, December 22, 2024
#919814419350 therichposts@gmail.com
Technologyxampp

how to create virtual host in xampp?

create virtual host in xampp

Hello to all, welcome to therichpost.com. 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:

<VirtualHost 127.0.0.2:80>
    DocumentRoot "C:/xampp/htdocs/therichpost"
  ServerName therichpost.localhost
</Directory>
</VirtualHost>

2. After it your need to add the below code in C:\Windows\System32\drivers\etc\hosts file:

127.0.0.2       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:
localhost/therichpost


After applying virtual host:
therichpost.localhost

 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. Therichpost.com

therichpost
the authortherichpost
Hello to all. Welcome to therichpost.com. Myself Ajay Malhotra and I am freelance full stack developer. I love coding. I know WordPress, Core php, Angularjs, Angular 19, MedusaJs, Next.js, 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.