Php 如何强制某些URL(.htacces)使用非SSL
如何强制一个文件使用非SSL?在这种情况下: 整个站点在HTTPS上运行 我只需要在HTTP上运行一个文件,其结构如下: 我已经在“folder3”上创建了一个.htacces,但是,。。。不行Php 如何强制某些URL(.htacces)使用非SSL,php,.htaccess,http,ssl,https,Php,.htaccess,Http,Ssl,Https,如何强制一个文件使用非SSL?在这种情况下: 整个站点在HTTPS上运行 我只需要在HTTP上运行一个文件,其结构如下: 我已经在“folder3”上创建了一个.htacces,但是,。。。不行 RewriteEngine On # Force non-SSL for certain URL's RewriteCond %{HTTPS} on RewriteRule ^https\:\/\/sitename\.com\/folder1\/folder2\/folder3\/FileName
RewriteEngine On
# Force non-SSL for certain URL's
RewriteCond %{HTTPS} on
RewriteRule ^https\:\/\/sitename\.com\/folder1\/folder2\/folder3\/FileName\.php\/?(.*)$ "http\:\/\/sitename\.com\/folder1\/folder2\/folder3\/FileName\.php\/?\/$1" [R=301,L,QSA]
Deny From All
<FilesMatch "^FileName\.php$">
Allow From All
</FilesMatch>
重新编写引擎打开
#强制某些URL的非SSL
在上重写cond%{HTTPS}
重写规则^https\:\/\/sitename\.com\/folder1\/folder2\/folder3\/FileName\.php\/?(.*)$“http\:\/\/sitename\.com\/folder1\/folder2\/folder3\/FileName\.php\/?\/$1”[R=301,L,QSA]
全盘否定
通融
示例URL:
谢谢为什么要这样做?因为此页面(filename.php)将从不同的外部站点加载iframe。当然,并非所有这些外部站点都是通过https提供服务的,例如:示例链接查询中给出的页面与https完美配合:是的,如果您从http更改为https,则可以工作,但其他外部页面不接受https-例如-