简体   繁体   中英

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?

80是http的默认端口号,因此您必须使用以下命令省略端口号:

sudo php artisan serve --host=localhost --port=80

If nothing else (eg 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 :-)

你可以试试

sudo php artisan serve --port=80

请勿在命令行中使用php artisan服务器,并在浏览器地址栏中使用完整的URL路径,如下所示

http://localhost/projectname/public

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM