[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)?
Twitter
10 Replies
Project ID:
N/A
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 ;_;
their code handles the routing, they want all traffic to be directed to index.php, similar to a spa react app with react router
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"
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
i dont know if this whole config will work for their specific use case, but line 34-36 does what they need
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/Vxe7zW6j61Twitter
Seems we've got a nixpacks config for it 😄
Thanks a mill tho Brody ❤️
ah if aleks was here he would have known that lol
I just implemented that a couple of weeks ago, because of a similar help request