How to add custom domain in localhost XAMPP Server

custom-domain-on-localhost-server how to add custom domain in localhost How to add custom domain in localhost XAMPP Server custom domain on localhost server

Are you still wondering for a solution to add a custom domain name to your PC Based Localhost server? So finally your search ends here. In this post, I am gonna show you a step by step process to make this setting fully working for your windows based Xampp Server. You would have already read so many tutorials and watched videos on the internet, But in this post, I will tell you the right way and proper instruction to complete this process and get it working easily.

Requirements

In this tutorial, I will implement this setting in Windows-based Xampp server. So Before you go ahead, Please make sure that you have at least Windows 7 and xampp server installed in your computer. If you don’t have Xampp, then simply download it from here.

After installation of Xampp on your computer, your main setting implementation starts. So follow all the steps carefully.

Step 1:

In step First, You need to go to your Computer’s C Drive where your Windows is installed and open host File in notepad

Go to: C:\Windows\System32\Drivers\etc\host

/** Now, You need to choose your custom domain name that you want to use in your localhost server, and add this below line at the end of Host file **/

127.0.0.1     yourdomain.com

After adding these lines of codes, simply save that file and exit.

Step 2:

Now you need to go to your Xampp Installation Directory. So follow the directories to find the right file to update with custom codes.

Go to [your XAMPP directory]/apache/conf/httpd-xampp.conf

 /** OR, If your httpd file has another name then it will be like below file name  **/

Go to [your XAMPP directory]/apache/conf/httpd-conf.conf

Step 3:

Now open your httpd-conf.conf or httpd-xampp.conf file in notepad and scroll down to the bottom of the file and add below codes.

<VirtualHost *:80>
   DocumentRoot "[YOUR WEBSITE DIRECTORY NAME]"
   ServerName yourdomain.com  /* This custom domain name should be same as you added in your last edited file.*/
   
   <Directory "[YOUR WEBSITE DIRECTORY NAME]">
     Options Indexes FollowSymLinks Includes ExecCGI
      AllowOverride All
      Require all granted
  </Directory>

</VirtualHost>


/** Now Replace [YOUR WEBSITE DIRECTORY NAME] with your website folder name that will be accessible from your custom domain name. **/

Ex: C:/xampp/htdocs/site-folder

Step 4:

Now the last step is to shut down your Xampp server and start it again in few seconds and check if it is starting apache and My SQL Successfully. If it starts Apache and MySQL successfully then enter your custom domain name in your browser’s address bar and run it and I am sure it will work.

I hope you enjoyed this article. So share it with your friends.

how to

phpwindowswordpressxampp

Leave a Reply

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