我有一个生成 URL 的 Zend 应用程序
http://miapp.com/module/controller/action/params/values
我想从 SSL 中排除具有参数的某个 URL(打印或下载)
实际上我有这个 .htaccess 参数来通过 SSL 重定向所有请求并生成动态 URL 重写
RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
RewriteCond %{REQUEST_FILENAME} !-s
RewriteCond %{REQUEST_FILENAME} !-l
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^.*$ /index.php [NC,L]
php_flag display_startup_errors off
php_flag display_errors off
php_flag html_errors off
但是如何排除包含打印或下载的 URL?
你试试这样的东西:(但我得到了重定向循环错误
RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [R=301,NC,L]
RewriteCond %{HTTPS} on
RewriteCond %{HTTP_REFERER} !^https(.*)/(print|download)(.*)$ [NC]
RewriteCond %{REQUEST_URI} !^(.*)/(print|download)(.*)$ [NC]
RewriteRule (.*) http://%{HTTP_HOST}%{REQUEST_URI} [R=301,NC,L]
RewriteCond %{REQUEST_FILENAME} !-s
RewriteCond %{REQUEST_FILENAME} !-l
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^.*$ /index.php [NC,L]
php_flag display_startup_errors off
php_flag display_errors off
php_flag html_errors off