R
Railway16mo ago
JustJake

[PHP] Route all requests to index.php

Josh Pigford (@Shpigford)
Obscure-ish @Railway PHP question. Is there some way I can route all requests to index.php (which is where I handle routing for the app)?
From Josh Pigford (@Shpigford)
Twitter
10 Replies
Percy
Percy16mo ago
Project ID: N/A
JustJake
JustJakeOP16mo ago
I don't quite understand their question, but I've also not written PHP in literal decades @silent @aleks who IIRC wrote the provider? Boomer moment with the at silent sorry Aleks ;_;
Brody
Brody16mo ago
their code handles the routing, they want all traffic to be directed to index.php, similar to a spa react app with react router
JustJake
JustJakeOP16mo ago
Yea. Seems to me a PHP config thing. Unsure if they're using Laravel or what not But there's gotta be some framework or language specific thing that says "Let me handle the routing"
Brody
Brody16mo ago
they would need to modify the nginx.template.conf file to send all requests to index.php ive helped other people do this before, ill see if i can find it
Brody
Brody16mo ago
i dont know if this whole config will work for their specific use case, but line 34-36 does what they need
JustJake
JustJakeOP16mo ago
Josh Pigford (@Shpigford)
@JustJake @Railway Thanks Jake! Actually just got it working. Setting NIXPACKS_PHP_FALLBACK_PATH to index.php did the trick, per the Nixpacks docs: https://t.co/Vxe7zW6j61
Twitter
JustJake
JustJakeOP16mo ago
Seems we've got a nixpacks config for it 😄 Thanks a mill tho Brody ❤️
Brody
Brody16mo ago
ah if aleks was here he would have known that lol
root
root16mo ago
I just implemented that a couple of weeks ago, because of a similar help request
Want results from more Discord servers?
Add your server