Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/297.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php .htaccess通过预先添加https从文件夹重定向到特定文件_Php_Apache_.htaccess_Redirect_Https - Fatal编程技术网

Php .htaccess通过预先添加https从文件夹重定向到特定文件

Php .htaccess通过预先添加https从文件夹重定向到特定文件,php,apache,.htaccess,redirect,https,Php,Apache,.htaccess,Redirect,Https,我做了一些研究,但找不到我真正需要的东西 到目前为止,如果要访问Linux主机上名为settings的文件夹,我会使用以下方法访问其中名为settings.php的文件: RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)$ settings.php [QSA,L] www.mydomain.com/settings/ 因此将触发:www.mydomain.com/settings/settings.p

我做了一些研究,但找不到我真正需要的东西

到目前为止,如果要访问Linux主机上名为settings的文件夹,我会使用以下方法访问其中名为settings.php的文件:

RewriteEngine On

RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ settings.php [QSA,L]
www.mydomain.com/settings/ 因此将触发:www.mydomain.com/settings/settings.php

但是现在,对于这个特定的文件,我想在前面包含https,不管是访问文件夹,还是包含一些额外php条件的文件,比如?status=1。 所以我认为我的第一句话(!-f)不再适用了

因此,无论是请求www.mydomain.com/settings/还是www.mydomain.com/settings/settings.php?whatever=1,以及www.mydomain.com/settings/?whatever=1, 我希望将https应用到它上

有人能帮我吗? 我将不胜感激


提前多谢

可能重复的谢谢!这很有帮助