Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/url/2.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
apache将除一个URL之外的所有URL重写为HTTPS_Apache_Url_Mod Rewrite_Ssl_Https - Fatal编程技术网

apache将除一个URL之外的所有URL重写为HTTPS

apache将除一个URL之外的所有URL重写为HTTPS,apache,url,mod-rewrite,ssl,https,Apache,Url,Mod Rewrite,Ssl,Https,我有一个网站,我正在引导所有非SSL流量使用https协议 我用过 RewriteCond %{HTTPS} off RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} 这很好,但我需要的网址 http://www.mywebsite.com/update-db.php 不要遵守这条规则 如何做到这一点?下面是一个例子,我需要重定向IE8的下载,因为它在使用SSL时存在错误。只需取出RewriteCond%{HTTP_USER_AGENT

我有一个网站,我正在引导所有非SSL流量使用https协议

我用过

RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
这很好,但我需要的网址

http://www.mywebsite.com/update-db.php 
不要遵守这条规则


如何做到这一点?

下面是一个例子,我需要重定向IE8的下载,因为它在使用SSL时存在错误。只需取出RewriteCond%{HTTP_USER_AGENT}^(.)MSIE\8.(.$[NC],并用您的php文件替换viewpdf

RewriteEngine On
#Fix for IE8 SSL Bug downloading PDF
RewriteCond %{HTTPS} on
RewriteCond %{HTTP_USER_AGENT} ^(.*)MSIE\ 8\.(.*)$ [NC]
RewriteCond %{REQUEST_URI} ^/(viewpdf.*)$ [NC]
RewriteRule ^/?(viewpdf.*)$ http://%{HTTP_HOST}%{REQUEST_URI} [L,NC]

RewriteCond %{HTTPS} off
RewriteCond %{REQUEST_URI} !^/(viewpdf.*)$ [NC]
RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [L]
只是:

RewriteCond %{REQUEST_URI} !^/update-db.php$
RewriteCond %{HTTPS} off
RewriteRule ^(.*) https://%{HTTP_HOST}%{REQUEST_URI}