1
Hello, good afternoon.
I recently hired a linux hosting service. My site uses the Slim Framework, but I’m not able to access its routes when it’s in production, but in the xampp localhost, it was working normally.
Slim routes for testing (not entering any)
$app->group("/teste", function() {
$this->get("/", function(Request $request, Response $response, $args = []) {
return $response->write("deu");
});
$this->get("/:nome", function(Request $request, Response $response, $args = []) {
return $response->write("deu ".$args['nome']);
});
});
My question is whether . htaccess is correct.
Located in public_html/slim/library/
Here is the index.php (from slim) and the . htaccess file
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [QSA,L]
tested different codes. htaccess sometimes gave error 404 and other error 500. Currently as above code, gives error 500.
And if you need to create an httpd.conf file and enable Allowoverride All. And how can I do that?
You can see in the image with the project directory, the /etc/ folder only has 2 files and a subfolder with the site name, which is empty too.
Could someone help me?
If the problem is with the Rewrite URL you can try using it like this:
index.php/teste
, for example. That’s what I did.– Not The Real Hemingway
@Nottherealhemingway hi, where I should put index.php/test?
– Caio Andrian
Take a look at my answer.
– Not The Real Hemingway