Menu Close

Custom local URL instead of localhost in Xampp

We Suppose that you already install xampp , lets suppose we have a project named ‘project1’ in htdocs folder

xampp/htdocs/project1

we will access this by http://localhost/project1 and now we will change this to any custom URL http://localproject1.com

Open xampp\apache\conf\extra\httpd-vhosts.conf file in any editor like notepad and put following code in bottom

<VirtualHost *:80>
    DocumentRoot "C:\xampp\htdocs\project1"
    ServerName localproject1.com
</VirtualHost>

Open new notepad as administrator

Open Windows\System32\drivers\etc\hosts file and put 127.0.0.1 localproject1.com at bottom

save file and restart Apache Server

Thats it!

Now you will be able to access project by http://localproject1.com, if still facing any issue please contact at hi@emadtech.com

Leave a Reply

Your email address will not be published. Required fields are marked *