I am new to PHP and especially Apache but I am familiar with NodeJS. I am trying to use the Slim Micro Framework with PHP/Apache and I am having problems due to my .htaccess because it never seems to give any errors, even with asdfasfsf
at the top of my .htaccess file.
I need this to run:
.htaccess
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php?url=$1 [QSA,L]
</IfModule>
So that my server will return trigger my http /home
route made with Slim, instead of searching for a /home
directory, but it has been really hard to debug when Apache doesn't throw any errors.
From my research, I believe I have to do something in the etc
folder, but I just installed Apache2_4 without any XAMP or WAMP, so I don't have this folder yet. I would appreciate any tips on using middleware to serve static .css and .js files as well if that's a thing.
routes.php
<?php
$server->get('/home', function ($request, $response) {
return 'Home';
});