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

Spdy's avatar
Level 1

Route not registering requests on live server

Hello

I'm comming to you in a time of need, hoping to get answers to a problem I've been batteling with for some time now.

I'm working on developing an api with two routes being used for tournaments when I'm arranging LAN events for my pupils.

However, the two routes do not work, when it is not in a localhost environment.

When I am hosting the gameserver on my own computer, and running the website on localhost, it works just fine. The server is able to contact the two routes, and transmit data.

When the website is uploaded, the routes is working just fine, however, it is not registering the gameservers attempt to contact the route.

I'm assuming it might be something with the headers, however, this is not the case. I also tried disabling the VerifyCSRF token on the two routes using the following code on the route:

"withoutMiddleware([\App\Http\Middleware\VerifyCsrfToken::class])"

I added a logging event to the routes (Log::info('Event 1 visited');) and nothing is registered in the live environment, but it is in the localhost environment.

The live environment is hosted on a VPS, where the server and website is located on the same IP.

I also tried creating a CORS middleware, without any luck.

I hope someone might be able to provide some feedback to a possible solution. The most important problem is making it so the routes are registering the gameservers attempt to contact it.

0 likes
3 replies
Snapey's avatar

Are you serving the same document root in both cases?

1 like
Spdy's avatar
Level 1

Thank you for your answer @Snapey

Yes, the document root of the website is the same as the one on my localhost.

However, Apache2 WAS configered to redirect http connections to https on my webhost - I removed this a week ago as I was thinking it could cause issues, it did no solve the problem.

However, your question made me wonder; I'm currently using nwidart/laravel-modules, where the routes are included in a module. Could creating a default controller and routes in the standard routes/web.php be a possible solution?

Spdy's avatar
Level 1

I could ellaborate on the question I asked in case there might be some confusion, with an example.

My setup is the following: I have two routes, Route 1 and Route 2.

The gameserver, needs to be able to contact both routes.

On localhost: Route 1 / Route 2 - Logs/registers my visit, and logs the gameservers visit

In live environment: Route 1 / Route 2 - Logs/registers my visit, and NOT the gameservers visit. Even though it is exactly the same URL being used.

Please or to participate in this conversation.