Is it possible to restrict access to only some PHP pages based on the same index.php?

Karly

New member
I have used a content management software that uses PHP to set up a client's website. The software uses the index.php file for all the pages, i.e. one page looks like "index.php?/page/." They want one of the pages to be password protected but not all of them. I successfully set up an .htaccess, but when I type:

<Files "index.php?/page/">
Require valid-user
</Files>

It doesn't have any effect. Is doing this even possible?
I understand how .htaccess works in general, and that you can protect a certain file, i.e. to protect the index.php file, I can type:

<Files "index.php">
Require valid-user
</Files>

...and it functions correctly. I am trying to figure out if I can protect just one of the PHP pages, i.e. instead of "index.php" which includes every page, just "index.php?/page1/."
 
Back
Top