PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Wednesday, February 16, 2022

[FIXED] How to change localhost url for Laravel

 February 16, 2022     laravel-5, localhost, url-rewriting     No comments   

Issue

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.


Solution

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



Answered By - Baadier Sydow
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing