Restrict php file in .htaccess based on mode/query string
I want to restrict access to a specific file (ucp.php), but ONLY in
registration mode. Ie, someone will have to authenticate in order to
register, but once registered will be able to access other ucp.php
functions (profile editing, for example), without being required to
authenticate again.
Since ucp.php is the only file with a "register" mode, I've tried:
<Files "^(.*)mode=register$">
require valid-user
</Files>
So far, I've only been able to restrict access no matter the function, or
not at all. I'm open to any alternative suggestions for how to do this.
Thanks!
EDIT
I also tried:
RewriteEngine on
RewriteCond %{QUERY_STRING} ^(.*)mode=register(.*)$ [NC]
RewriteRule require valid-user
That didn't work either, but as you can probably tell, I'm just kind of
stitching things together trying to get it to work.
Any suggestions?
No comments:
Post a Comment