Harman
Harman

Reputation: 1753

How i can remove port number in url

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?

Upvotes: 3

Views: 4053

Answers (4)

Prakash Bhandari
Prakash Bhandari

Reputation: 567

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

http://localhost/projectname/public

Upvotes: 0

Salar
Salar

Reputation: 5509

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

Upvotes: 5

Sachith Muhandiram
Sachith Muhandiram

Reputation: 2972

You can try

sudo php artisan serve --port=80

Upvotes: 2

herrjeh42
herrjeh42

Reputation: 2793

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 :-)

Upvotes: 1

Related Questions