RewriteEngine On
RewriteBase /

# Exclude requests to /backend and its subdirectories from redirection
RewriteCond %{REQUEST_URI} !^/backend

# Redirect all other requests to your PHP script
RewriteRule ^(.*)$ index.php [L,QSA]