问题
I have tried some htaccess senteces but it doesn't work for me. I need to use whole site with https except one page it requires http connection from another site so i need to disable https for this page.
Options +FollowSymLinks
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^.*$ https://%{SERVER_NAME}%{REQUEST_URI} [R,L]
RewriteCond %{HTTPS} on
RewriteCond %{SCRIPT_FILENAME} \/exp\.php [NC]
RewriteRule ^(.*)$ http://%{HTTP_HOST}/$1 [L,NC]
browser says it seems there is too many redirections.
回答1:
You can use the following code :
Options +FollowSymLinks
RewriteEngine On
RewriteCond %{HTTPS} ^off$
RewriteCond %{REQUEST_URI} !exp\.php$
RewriteRule ^.*$ https://%{SERVER_NAME}%{REQUEST_URI} [R,L]
来源:https://stackoverflow.com/questions/34084170/disable-https-for-single-page-with-htaccess