Hi,
i have this file structure:
/
/index.php
/test.php
/example/foo/bar/test.php
/cache/index.htm
/cache/test.htm
/cache/foo/bar/test.htm
everything in /cache/* is a flat file (.htm) of the generated php files.
Basically what i want to do is this -
- a user requests
/index.htm
(users will never see a .php in their url even if its made on the fly) - .htaccess checks if
/cache/index.htm
exists. if so, it reads from that file. - if
/cache/index.htm
doesn't exist, it serves index.php
another example
- a user requests
/example/foo/bar/test.htm
- if
/cache/example/foo/bar/test.htm
exists, it reads from it - if it doesn't exist, the user is shown
/example/foo/bar/test.php
(but doesn't see the .php extension)
is this possible at all in .htaccess?
thanks
(btw i make the cache files elsewhere. so no need to making them on the fly)