2
特定文件HTTPS,我想強制HTTP來代替https力HTTP而不是僅僅針對一個特定的文件
例子:
https://example.com/test.php?parameter1=value1
應該發送到
http://example.com/test.php?parameter1=value1
我怎樣才能做到這一點?
特定文件HTTPS,我想強制HTTP來代替https力HTTP而不是僅僅針對一個特定的文件
例子:
https://example.com/test.php?parameter1=value1
應該發送到
http://example.com/test.php?parameter1=value1
我怎樣才能做到這一點?
你的問題不是很清楚,但試試這個的.htaccess代碼:
Options +FollowSymLinks -MultiViews
RewriteEngine on
RewriteCond %{QUERY_STRING} ^parameter1=.*$ [NC]
RewriteCond %{HTTPS} !=on
RewriteRule ^test\.php/?$ https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L,QSA,NC]
這將重定向只有當查詢字符串parameter1=something
是存在於原始URL。如果您想將所有/test.php
URI重定向到https,請刪除第一條RewriteCond行。
是這樣的:
RewriteRule ^https://example.com(.*) http://example.com$1 [R=301,NC]