简体   繁体   中英

apache (lamp) htaccess php allow access for specific form

I have some files on the server which are protected using htaccess. My problem is that I have a form (php) which will be used by clients to submit some data and this form accesses some files which are protected (eg controller.php where I'm querying the db to check if the email is in the database and other types of functionality).

Is there a way to specify that those protected files should be accessible if they are accessed from my form? Otherwise request password or something similar?

What are my options in order to be able to protect my files but still let them be accessed by the form (which is available for users)?

I think you could create a RewriteCond checking the HTTP-Referer header as described in the link down below.

http://www.kavoir.com/2010/05/use-htaccess-to-allow-access-only-from-a-single-http-referrer.html

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM