Assuming using XAMPP Server
- Open
[C:\Windows\System32\Drivers\etc\hosts](file://C:\Windows\System32\Drivers\etc\hosts)
127.0.0.1 something.local
- Go to [your_XAMPP_directory]\apache\conf\httpd.conf by ussualy its located in
[C:\xampp\apache\conf\httpd.conf](file://C:\xampp\apache\conf\httpd.conf)
and at the bottom of the file:
<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.
-
Open the XAMPP Control Panel
-
Stop Apache , wait for 5 seconds,
-
then finally "Start" Apache Server.
Assuming using LAMPP
- Go to
/etc/hosts
and add this to the bottom of the file:
127.0.0.1 something.local
- Go to
/opt/apache/conf/httpd.conf
at the bottom of the file:
<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:/opt/lampp/htdocs/
. - something.local must be the same on Step 1 & Step 3.
- Restart Apache Server
sudo /opt/lampp/apache stop
sudo opt/lampp/spache start
Assuming all went well, go to your browser, type http://something.local and it will now happily point to your custom local folder.