alphaolomi
3/11/2019 - 5:05 AM

Custom localhost Url

Custom localhost Url

Custom Localhost Url

For Windows

  1. Go to [C:\Windows\System32\Drivers\etc\hosts](file://C:\Windows\System32\Drivers\etc\hosts) and add this to the bottom of the file:

    • copy & paste this code:
    127.0.0.1     something.local
    
  2. Go to [your_XAMPP_directory]\apache\conf\httpd.conf by default its located in [C:\xampp\apache\conf\httpd.conf](file://C:\xampp\apache\conf\httpd.conf) at the bottom of the file:

    • copy & paste this code:
    <VirtualHost *:80>
       DocumentRoot "[PATH_TO_YOUR_CUSTOM_FOLDER]"
       ServerName something.local
    
       <Directory "[PATH_TO_YOUR_CUSTOM_FOLDER]">
         Options Indexes FollowSymLinks Includes ExecCGI
          AllowOverride All
          Require all granted
    </Directory>
    
    </VirtualHost>
    
    • Replace [PATH_TO_YOUR_CUSTOM_FOLDER] to the folder where your files are located. Ex: C:/xampp/htdocs/.

    • something.local must be the same on Step 1 & Step 3.

  3. Stop Apache on XAMPP, wait for 5 seconds, then click "Start" to start again your Apache.

If all things go well, you can go to your browser, type http://something.local and it will now happily point to your custom local folder.