So i’m pretty terrible at RewriteRule and .htaccess, and I’ve been trying to create a RewriteRule which allows me to redirect any request that doesn’t already exist in the directory through index.php.
It looks like this at the moment:
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?name=$0 [L]
However once I started trying to run ajax requests from a redirected url it breaks and returns the whole redirected page instead of the return data of any script that is in the directory. I’m pretty confused as to how I can make this work. \
What I want to be able to do is to be able to rout every non-real request through index.php and every other request as normal.
You could sneak in another
RewriteCondusing a RegEx, in case you can find one (or more) for you normal requests. Something like