Hi,
I have quite a simple site structure, with each page having a separate html file.
https://test.com/page1
https://test.com/page2
https://test.com/page3
These can have any number of subfolders before the final file;
https://test.com/something/something-else/page4
However, I need to dynamically generate these HTML files. That means I need PHP files to echo the HTML content, but at the same time I'd like to remove the whole file structure on the disk. My idea is to re-route the requested pages to a single PHP file, which echoes the corresponding content.
So for example:
https://test.com/something/something-else/page4?example_get_data=whatever
should become, in the background and NOT shown in the browser:
https://test.com/find.php?path=something%2Fsomething-else%2Fpage4%3Fexample_get_data%3Dwhatever
So I got to writing a .htaccess file, but it's not passing the path properly:
RewriteEngine On
RewriteBase /
RewriteRule ^(.+)$ find.php?path=$1 [L,B]
I've chosen those flags because:
• Nothing past this rule should be considered
• I was hoping B would escape the path properly, but it doesn't.
What I have tried:
------------------------------------------------------------