I'm struggling with creating a set of rules in my .htaccess file, resulting in constant 500 Internal Server Errors instead.
RewriteRule ^(.*)\.php$ /router.php?rq=$1 RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)$ /router.php?rq=$1 [L,QSA] I want my .htaccess to behave like this:
All requests (except resources, images, CSS, js, etc) should redirect to /router.php, preserving query strings. I don't need the REQUEST_URI as a query string as it is available via
$_SERVER['REQUEST_URI']regardless.All attempts to access a PHP file directly, for example user enters "index.php", should also redirect to router.php.