Skip to main contentSkip to footer

Steps to create custom URL to work locally Xampp localhost virtual host

Rupak Nepali
Share:
Steps to create custom URL to work locally Xampp localhost virtual host

Steps to create a custom URL to work locally:

If you had installed Xampp in D:/ folder then follow the following steps, if you have installed in C:/ or another folder then replace D with respective folder name.

  • Open up the Xampp control panel and stop Apache (Ensure that you don’t have it running as a service.
  • Navigate to D:/xampp/apache/conf/extra or wherever you installed Xampp
  • Open up your text editor with administrative privileges and open up httpd-vhosts.conf found in the D:/xampp/apache/conf/extra folder
  • At the very bottom of the file paste the following (check if it exists there already) <VirtualHost *:80> DocumentRoot “D:/xampp/htdocs” ServerName localhost </VirtualHost>
  • Without that line of code, you will lose access to your default htdocs/ For eg: http://localhost/ will be inaccessible.
  • Now copy and paste the code below: <VirtualHost *:80> DocumentRoot “D:/xampp/htdocs/webocreation” ServerName webocreation.dev ServerAlias www.webocreation.dev <Directory “D:/xampp/htdocs/webocreation”> AllowOverride All Require all Granted </Directory> </VirtualHost>
  • Now we head over to our Windows Hosts File, to edit the HOSTS. File will be located at C:/Windows/System32/drivers/etc/hosts, where hosts is the file. 127.0.0.1             localhost
  • Look for the line above and enter your site mimicking the layout 127.0.0.1             localhost 127.0.0.1             webocreation.dev
  • Change this to the domain name you choose earlier
  • Change it to reflect the lines above (if you have problems saving it meant you didn’t have your text editor running in admin mode.
  • Restart Apache and test to make sure it is working.
  • Go to the URL

Comments

Join the conversation and share your thoughts

Leave a Comment

Your comment will be reviewed before publishing.

Be the first to comment on this post!

Innovation

Let's Make Something Amazing Together

We always provide our best creative ideas at the highest level. Tell us about your project and we will make it work.

InnovateBringing innovative solutions to complex problems
AutomateStreamlining processes through automation
DominateLeading the market with exceptional results
Build Smarter and Launch FasterEfficient development for rapid deployment