Server 从HTTP重定向到HTTPS,查询Get无法正常工作

Server 从HTTP重定向到HTTPS,查询Get无法正常工作,server,Server,您好,很难找到从链接重定向我的页面的解决方案: 到 这是我的.htaccess文件: RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.+)$ index.php?id=$1 [QSA,L] RewriteCond %{HTTPS} off RewriteRule (.*) https://%{HTTP_H

您好,很难找到从链接重定向我的页面的解决方案: 到

这是我的.htaccess文件:

RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

RewriteRule ^(.+)$ index.php?id=$1 [QSA,L]

RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}
只有将整页地址与https一起使用时,它才能正常工作

我找到了解决问题的方法:

RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

RewriteRule ^(.+)$ index.php?id=$1 [QSA,L]

<If "%{HTTPS} == 'off'">
    RewriteEngine On
    RewriteCond %{HTTPS} off
    RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [R,L]
</If>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

RewriteRule ^(.+)$ index.php?id=$1 [QSA,L]

<If "%{HTTPS} == 'off'">
    RewriteEngine On
    RewriteCond %{HTTPS} off
    RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [R,L]
</If>
重新编写引擎打开
重写基/
重写cond%{REQUEST_FILENAME}-F
重写cond%{REQUEST_FILENAME}-D
重写规则^(+)$index.php?id=$1[QSA,L]
重新启动发动机
重写条件%{HTTPS}关闭
重写规则^https://%{HTTP_HOST}%{REQUEST_URI}[R,L]

我找到了问题的解决方案:

RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

RewriteRule ^(.+)$ index.php?id=$1 [QSA,L]

<If "%{HTTPS} == 'off'">
    RewriteEngine On
    RewriteCond %{HTTPS} off
    RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [R,L]
</If>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

RewriteRule ^(.+)$ index.php?id=$1 [QSA,L]

<If "%{HTTPS} == 'off'">
    RewriteEngine On
    RewriteCond %{HTTPS} off
    RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [R,L]
</If>
重新编写引擎打开
重写基/
重写cond%{REQUEST_FILENAME}-F
重写cond%{REQUEST_FILENAME}-D
重写规则^(+)$index.php?id=$1[QSA,L]
重新启动发动机
重写条件%{HTTPS}关闭
重写规则^https://%{HTTP_HOST}%{REQUEST_URI}[R,L]

这是否回答了您的问题?不幸的是没有,因为我需要从http重定向到https(这很好),除了将查询转换为?id=100的部分之外,我找到了正确工作的解决方案