Assume the following folder structure on the webserver (Apache): https://somedomain.com/parentfolder/childfolder
.
Using .htaccess
, I'd like to display the childfolder
and any of it's children (files as well as folders) only the URL contains a certain parameter. For example, the page should be shown if it's requested by:
https://somedomain.com/parentfolder/childfolder?secretparameter=secretvalue123
However if
- the value of parameter
secretparameter
is not exactlysecretvalue123
or - the parameter
secretparameter
is missing,
then a 404 error should be returned.
Do you have any ideas how the .htaccess rules would look like to accomplish this? Your help is greatly appreciated, thank you.