Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

PHP Laravel Basics MVC (View) Extending Blade Templates

Localhost site buttons don't work, but adding /whatever to the URL does. Why?

I thought I followed the instructions correctly, but like the title says, my site buttons don't function. Clicking on "Tracks" gets me this page:

"Not Found The requested URL /tracks was not found on this server."

I can still navigate to the pages by manually adding type to the url (ex, making http://localhost:8000 into http://localhost:8000/tracks), but that's the only way I can do it.

Can y'all help me understand what might be going on here? I tried poking around the Laravel code and checking Stack Overflow, but no luck.

Dario Preglej
Dario Preglej
9,771 Points

I have the same problem and i dont know how to fix it!

Michael Driver
Michael Driver
22,331 Points

What's probably going on is that the links are removing your port number (:8000). If you go into your env file for the project and change APP_URL from http://localhost to http://localhost:8000 and restart your development environment it should work.

3 Answers

Matt Roger
Matt Roger
15,066 Points

In the .env file change APP_URL from APP_URL=http://localhost to APP_URL=http://localhost:8000. Then reset your server.

Steven Jackson
Steven Jackson
11,465 Points

Also, make sure your server is configured to use localhost:8000 .

Elinor Armsby
Elinor Armsby
13,654 Points

thank you! I was pulling my hair out as to why the links didn't work!