3

Maybe a pretty basic question but I want to know that how I can change my localhost URL for larvel from localhost:8000 to something.com. I searched but I found solutions for xampp and wamp which does not apply to laravel I think.

StealthTrails
  • 2,281
  • 8
  • 43
  • 67
  • 2
    see this blog http://www.contecha.com/blog/setting-up-a-local-development-url-with-apache/ – GWed Nov 25 '15 at 13:54

2 Answers2

3

Its quite simple to set up.

You need to ensure that you're mapping the domain you want to use in your homestead.yaml file so it would like this for example:

sites:
    - map: something.com
      to: /home/vagrant/Code/Laravel/public

The to: in the mapping points to the location of the public folder in your Laravel installation on Homestead.

Then you need to edit the hosts file on your computer.

It's located at /etc/hosts on Mac or Linux alternatively you can find it at C:\Windows\System32\drivers\etc\hosts on Windows.

You will need administrator rights to change this.

Now change this:

192.168.10.10  something.com

You can change the something.com to the domains you want to use.

More info at Homestead documentation

Baadier Sydow
  • 506
  • 1
  • 6
  • 19
  • I am not using homestead – StealthTrails Nov 23 '15 at 15:06
  • 1
    The method is largely the same. You need to make sure XAMPP, WAMP etc is listening for traffic to that domain and then point your local hosts file at your server which is usually 127.0.0.1 So for example using XAMPP you would add an addition to your httpd-vhosts.config file mapping the domain to the public Laravel folder. I believe this is found in C:/xampp/apache/config/extra/ I'm not sure what server you're using or if you're on Mac, Linux or Windows. FWIW using Homestead will make your life easier. I kept running into frustrating issues before making the change. – Baadier Sydow Nov 24 '15 at 07:53
1

VlcdeMacBook-Pro:blog vlc$ php artisan serve --port=9200 Laravel development server started: http://127.0.0.1:9200

just like this can change

vlass
  • 27
  • 5