i want to understand at least abit on how the .htaccess
works. i am using the .htaccess
from zend framework (since thats what i use often)
SetEnv APPLICATION_ENV development
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^.*$ index.php [NC,L]
1st line to set an environment variable, ok simple enuf, but what do the subsequent lines do? whats the -s -l [NC,L]
etc for. from the apache docs i can see that
-s
- refers to a "regular file with a size". just curious is there a non-regular file?-l
- refers to a symbolic link - whats that-d
- refers to a directioryREQUEST_FILENAME
- full local filesystem path to the file or script matching the requestREQUEST_URI
- resource requested in the HTTP request line.
assuming i browsed to "http://localhost/some/path/here
". what will REQUEST_FILENAME
& REQUEST_URI
equals to?
anyway, i interpret the rules currently as
- if the request is for a file with size OR
- if the request is for a link OR
- if the request is for a directory
- ... do something ...
- what does
RewriteRule ^.*$ - [NC,L]
do? - then i guess route everything matching the rules above to index.php