Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

DimZ's avatar
Level 4

301 Moved Permanently on my colleague's computer

Hello,

2 new colleagues have installed my Laravel project, the first is one Ubuntu (PHP, Apache, MySQL installed from apt) and the another is on Mac (MAMP).

The first one has successfully installed the app, and everything is working.

But the another has an infinite redirect error when he tries to access to the app. When he accesses to http://localhost:8888/my-project/public/ from CURL, the app redirects to http://localhost:8888/my-project/public. And vice versa, http://localhost:8888/my-project/public redirects to http://localhost:8888/my-project/public/.

I don't know what the issue is from. Somebody has an idea?

Thanks a lot!

0 likes
3 replies
arukomp's avatar

trying setting up the environment variables, this one in particular:

APP_URL="http://localhost:8888/my-project/public/"
Cronix's avatar

Better yet, put it in it's own vhost properly, so "/public" isn't in the url at all and the url can just be "http://project.test/". That's really the proper way to do it.

DimZ's avatar
Level 4

@Cronix This is actually I do personally, and I think I will do it the same tomorrow, instead of trying to make it work this path.

I'll keep you in touch.

Thanks!

Please or to participate in this conversation.