This tutorial is specific to Windows.
Be sure to stop XAMPP completely if it’s running. Especially Apache.
Locate the following file – C:\Windows\System32\Drivers\etc
Open the file with Administrator privileges and add the following at the bottom of the file:
# Copyright (c) 1993-2006 Microsoft Corp. # # This is a sample HOSTS file used by Microsoft TCP/IP for Windows. # # This file contains the mappings of IP addresses to host names. Each # entry should be kept on an individual line. The IP address should # be placed in the first column followed by the corresponding host name. # The IP address and the host name should be separated by at least one # space. # # Additionally, comments (such as these) may be inserted on individual # lines or following the machine name denoted by a '#' symbol. # # For example: # # 18.104.22.168 rhino.acme.com # source server # 22.214.171.124 x.acme.com # x client host # localhost name resolution is handle within DNS itself. # 127.0.0.1 localhost # ::1 localhost 127.0.0.1 yoursite.dev
Save the file.
Navigate to C:\xampp\apache\conf\extra and look for the file named httpd-vhosts.conf and open it.
Add the following to it:
DocumentRoot "C:\xampp\htdocs" ServerName localhost DocumentRoot "C:\xampp\htdocs\yoursite.dev" ServerName yoursite.dev Order allow,deny Allow from all
If you wish to add additional sites, you can do so:
DocumentRoot "C:\xampp\htdocs" ServerName localhost DocumentRoot "C:\xampp\htdocs\yoursite.dev" ServerName yoursite.dev Order allow,deny Allow from all DocumentRoot "C:\xampp\htdocs\yoursite2.dev" ServerName yoursite2.dev Order allow,deny Allow from all DocumentRoot "C:\xampp\htdocs\yoursite3.dev" ServerName yoursite3.dev Order allow,deny Allow from all
Now update the URL’s in Setting –> General e.g.:
WordPress Address (URL): http://yoursite.dev
Site Address (URL): http://yoursite.dev
Now start XAMPP or Apache.
Enjoy your XAMPP custom domains!
The post XAMPP custom domains appeared first on Pinsoft Studios.
This post first appeared on Web Design Company | Cape Town | Pinsoft Studios | Articles, please read the originial post: here