I’ve been battering my head against this all evening and can’t see where I’m going wrong. I want to set a host, mysite.local, on xampp and have followed all the instructions, but I keep getting redirected to mysite.local/xampp.
Any ideas where I’m going wrong here? The paths are correct, and I’ve restarted Apache 🙂
I edited my hosts file to add:
127.0.0.1 mysite.local
I edited extra/httpd-vhosts.conf:
NameVirtualHost localhost:80
<VirtualHost localhost:80>
ServerName localhost
DocumentRoot "/Applications/XAMPP/xamppfiles/htdocs"
<Directory "/Applications/XAMPP/xamppfiles/htdocs">
Options Indexes FollowSymLinks MultiViews
AllowOverride all
Order Deny,Allow
Allow from all
</Directory>
</VirtualHost>
<VirtualHost localhost:80>
<Directory "/Applications/XAMPP/xamppfiles/htdocs/wd">
Options Indexes FollowSymLinks MultiViews
AllowOverride all
Order Deny,Allow
Allow from all
</Directory>
DocumentRoot "/Applications/XAMPP/xamppfiles/htdocs/wd"
ServerName mysite.local
</VirtualHost>
I’ve just got the very same problem yesterday. Even if the steps you did are correct in a context, you need to do some more tasks 😉
You also need to edit Apach’es
httpd.confreferring to your new VirtualHost like this:With this alone you’ll be able to access
http://mysite.localwithout the redirection to the XAMPP splash screen BUT you’ll see the directories of your proyect (at least if you don’t have and index in the root folder)If you need to load a file from a folder (for example /public/index.php) you’ll need to use an
.htaccessfile. Remember this file must be in the folder(s) you want to have control. So for example, an.htaccessfile located at the root of your project to redirect to the/public/index.phpfile you must do it this way:Just remember to use the correct regular expression you need and don’t forget to take preventive measures with more security in a production website 😉 I wish I’ve helped you out =)