FastRoute icon indicating copy to clipboard operation
FastRoute copied to clipboard

why fastRoute not working in my server

Open pabios opened this issue 3 years ago • 8 comments

hello my local project work but when i am uploading code to server nothing work .

i.e : this way localhost:9000/hello works but this one http://api.domaine.com/hello does not working

could someone help?

thank you

pabios avatar Sep 28 '22 21:09 pabios

@pabios there are so many different things that might be happening on the server... It's very difficult to help you without knowing (at least) error messages.

lcobucci avatar Sep 30 '22 06:09 lcobucci

@lcobucci Thank you for your reply . by the way, I just have a 500 error. as a response from the server. when i change my route to $r->addRoute('GET', 'index.php/hello', '\Pabiosoft\Controller\FastController::direBonjour'); it'is work but i just want to send $r->addRoute('GET', '/hello', '\Pabiosoft\Controller\FastController::direBonjour'); without index.php prefixe in my addRoute

other tip ?

pabios avatar Oct 03 '22 11:10 pabios

index.php/hello does not look right.

omatamix avatar Nov 07 '22 04:11 omatamix

Looks like you need route all requests to your index.php file.

RewriteEngine On 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]

This might fix your error.

omatamix avatar Nov 07 '22 04:11 omatamix

Looks like you need route all requests to your index.php file.

RewriteEngine On 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]

This might fix your error.

Without this ,fast router will not work ?

dontKnew avatar Jan 20 '23 02:01 dontKnew

Mine also same problme !

dontKnew avatar Jan 20 '23 02:01 dontKnew

I would suggest this crucial additional information is added to the documentation/readme.

JanisE avatar Feb 13 '23 13:02 JanisE

The webserver configuration is beyond the scope of this library and I'd prefer not to have to add configuration for Apache, Nginx, Caddy, etc.

We can surely do a better job and reinforce the need for sending all requests to the file that is routing your application :+1:

I'll squeeze this in before tagging the first pre-release versions, but feel free to send PRs.

lcobucci avatar Jan 09 '24 21:01 lcobucci