Reputation: 2395
Is it a way to start a Laravel project in another folder? For example:
instead of C:/xampp/htdocs
to D:/projects/web/project1
So after I download Laravel with composer to my D:/projects/web/project1
folder I want to reach it as: http://project1.local
in my browser.
I added 127.0.0.1 project1.local to my hosts but it only opens xampp in the browser.
Suggestions, ideas?
Upvotes: 0
Views: 5826
Reputation: 236
You need to indicate to xampp
that your site will be sited outside the documentroot
folder (where all the sites in your server are located).
In your httpd.conf
file add these lines, which will allow to you to access the site via http://localhost/laravel.project
:
Alias /laravel.project "D:/projects/web/project1/public"
<Directory "D:/projects/web/project1/public">
Options FollowSymlinks
AllowOverride none
Require all granted
</Directory>
If you want to get access directly, via a uri like http://laravel.project
, you must create a VirtualHost.
Upvotes: 5