In Nginx I played around with try_files which basically took any request for a file on the domain and passed it through a custom php script called file_parse.php. In Nginx it looked like this: try_files $url /file_parse.php
If the file did exist in the document root then it did not use try_files. This rule in Nginx doesn't redirect the user, for example if a user types in http://www.domain.com/123456.html that address shows in their browser but file_parse.php takes 123456.html and echo's out html code based on the number (123456). If file_parse.php doesn't have anything to echo out then file_parse.php sets a 404 header for the client.
Does something like this exist in Apache?
Found an answer, seems to work, no errors in error.log:
<Directory /this/is/the/directory/>
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . file_parse.php [L]
</Directory>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With