John Deep
John Deep

Reputation: 45

How to set mydomain.com locally in laravel?

I am new to laravel, and I have installed a fresh copy of laravel. My project root directory is located in E:/xampp/htdocs/myapp and I want this to load on myapp.com in browser how exactly to do this ? I am using laravel 5.2 and xampp for my project.

Upvotes: 2

Views: 229

Answers (2)

Rahul M
Rahul M

Reputation: 1509

If you're using Laravel 5.2 Valet is a pretty nice tool.

Upvotes: 1

Iftikhar uddin
Iftikhar uddin

Reputation: 3192

It is possible with enabling virtual host on your xampp settings. First of all you need to visit E:\xampp\apache\conf\extra\https-vhosts.conf and make some edits. Edit httpd-vhosts.conf file in your favorite editor and add the below code at end of the httpd-vhosts.conf file.

<VirtualHost *:80>
    DocumentRoot "E:/xampp/htdocs/yourprojectfolder/public"
    ServerName yourdesirename.com
</VirtualHost>

After this you need open notepad as administrator and edit hosts file

(C:\Windows\System32\drivers\etc\hosts)

Note : If hosts file is not showing in the target directory you need to change the select box to 'Show All Files'

and add 127.0.0.1 localhost yourdesirename.com at the end of hosts file, once done now open your browser and type yourdesirename.com and your project will dance live there.

Upvotes: 3

Related Questions