I have a structure called /pdf/
where generated PDFs are stored. I am trying to use .htaccess to route visitors to the PDF folder.
I have this rule in my .htaccess file:
RewriteEngine On
RewriteBase /
RewriteRule (.*) index.php?page=$1.html
RewriteRule ??? for pdf??
(Note the ???
marks...)
When I try to access the url /manual_chap_1
it is working. But when I try /pdf/manual_chap_1
it doesn't seem to be working. Here is some output I see:
$_GET[page] => index.php.html
I want to be able to generate the PDF file, if the PDF file does not exist in the requested location, and then, I want it to load an HTML page.