How can I prevent access to PHP files if the caller isn't using HTTPS?

前端 未结 5 590
梦如初夏
梦如初夏 2020-12-06 19:48

I have written several PHP web services where I pass in arguments via the URL. To prevent unauthorized access, I pass in a unique key as one of the arguments. I call the PHP

5条回答
  •  没有蜡笔的小新
    2020-12-06 20:35

    Slightly off topic, but if you're using PHP with Apache Httpd and mod_ssl, you can force SSL access to files (and PHP scripts) by placing the SSLRequireSSL directive in .htaccess or in the Directory configuration.

提交回复
热议问题