3

I am using laravel framework in ubunto system and I want to remove port number from my url

write now I can access my web-project with this url

http://localhost:8000

and I want this url

http://localhost/

How can I do this?

Harman
  • 1,703
  • 5
  • 22
  • 40
  • 1
    Possible duplicate of [How to run laravel 5 on port 80 of localhost?](http://stackoverflow.com/questions/29592441/how-to-run-laravel-5-on-port-80-of-localhost) – Toby Speight Jun 21 '16 at 14:26

4 Answers4

5

80 is the default port number of http so you have to use this command to omit the port number:

sudo php artisan serve --host=localhost --port=80
Salar
  • 5,305
  • 7
  • 50
  • 78
2

You can try

sudo php artisan serve --port=80
Sachith Muhandiram
  • 2,819
  • 10
  • 45
  • 94
  • 1
    Please edit with more information. Code-only and "try this" answers are discouraged, because they contain no searchable content, and don't explain why someone should "try this". We make an effort here to be a resource for knowledge. – Brian Tompsett - 汤莱恩 Jun 21 '16 at 16:16
1

If nothing else (e.g. Apache oder Nginx) uses port 80 you COULD start the development webserver like this

 sudo php artisan serve --port 80

You can access the app via http://localhost/ afterwards

Note that this is ONLY for development and some kind of hack. Install a dedicated webserver (Apache, Nginx) for production :-)

herrjeh42
  • 2,782
  • 4
  • 35
  • 47
0

Do not use php artisan server in your commandline and use full URL path in browsers address bar as follows

http://localhost/projectname/public
Prakash Bhandari
  • 549
  • 8
  • 16
  • I can run this http://localhost/abc/public/ but when i redirect on any link http://localhost/jobma/public/contact then i will not work – Harman Jun 22 '16 at 04:21
  • Ya i understand the problem. Then , please follow this link http://tutsnare.com/remove-public-from-url-laravel/ – Prakash Bhandari Jun 22 '16 at 04:50