After rewriting all my url rules, everything that is passed is treated as a rewrite rule this results in no 404 pages ever! How can I serve 404 pages for pages that are not found i.e. example.com/books is url rewritten which is fine. However example.com/dfersfn isnt but this is also served and 404 is sent. Heres the content from my htaccess:
RewriteEngine on
RewriteRule \.(css|jpe?g|gif|png|js|ico|svg)$ - [L]
RewriteCond %{REQUEST_URI} "/f1/" [OR]
RewriteCond %{REQUEST_URI} "/f2/" [OR]
RewriteCond %{REQUEST_URI} "/f3/"
RewriteRule (.*) $1 [L]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} ^/(.*?)/?$
RewriteCond %{DOCUMENT_ROOT}/%1.php -f
RewriteRule ^(.*?)/?$ /$1.php [L]
RewriteRule ^([A-Za-z0-9-]+)/?$ book.php?slug=$1 [NC,L]
RewriteRule ^([A-Za-z0-9-]+)/(.*)/? read.php?slug=$1&cslug=$2 [NC,L]