Create Virtual Hosts | Windows & XAMPP | Custom URLs for localhost Projects
HTML-код
- Опубликовано: 16 июн 2021
- Create a virtual host to manage URLs of local projects effectively by using XAMPP and Windows. Let's say I have two folders for two projects in XAMPP. To run files from it, I will have to spin up XAMPP server. These are URLs for the dummy projects I have right now:
localhost/test-projects/project-one
and
localhost/test-projects/project-two
How about changing these to something like
projectone.local
and
projecttwo.local
To do that we will need to edit httpd-vhosts.conf file from XAMPP and Windows hosts file.
We will need to add a virtual host in this file. This virtual host will take document root path for project and new server name of your choice. Don't use http here in server name.
We will edit hosts file in windows. Do not forget to take backup for the hosts file. This file will resist changes as it's in secure location in Operating System files. You can copy this file, to some other location, edit it and replace it in this folder. In this file add local IP address and new server names or virtual host names or URLs in it.
Don't use http before URLs in hosts file also. Don't use .dev in URL, it might give you message that "connection not private". You can use anything else instead of .dev in URL. Try using .local or .my or anything else.
Restart Apache server. Open new URLs in web browser and enjoy using new URLs for your local projects.
Thank You!
👍 LIKE VIDEO
👊 SUBSCRIBE
🔔 PRESS BELL ICON
✍️ COMMENT
Channel: / webstylepress
Website: www.webstylepress.com
FaceBook: / webstylepress
Twitter: / webstylepress
Instagram: / webstylepress
LinkedIn: / webstylepress
GitHub: github.com/webstylepress
#windows #xampp #hosts #virtualhost #webstylepress #webdevelopment #localserver #localhost
To watch more related videos, please LIKE, SHARE & SUBSCRIBE! WebStylePress needs your support.
thank you it worked wonderfully
Thanks you sir.
are you able to put project files on a different drive? it doesn't seem to want to start apache when i do.
giving me 404
You may be missing something in process.