(php newbie here)
I'm writing a very simple router for a mostly static marketing website. So far, I have every request that doesn't match a file go through my index.php.
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule . /index.php [L]
</IfModule>
And in my index.php, I decide what to output. This is working pretty well.
But what happens if a user browses specifically to a file I don't want them to go to? It won't go through my index.php. So I could remove that condition... but what about css files? I'm guessing I could include those as well. But then... what about images?
I'm guessing there's a better way that I just don't know about yet.
(One request: Please don't suggest using a framework. I'd like to learn how things work before I use somebody else's code.)