简体   繁体   English

TYPO3 HTACCESS | 将HTTPS更改为url中的HTTP会将我重定向到根页面

[英]TYPO3 HTACCESS | changing HTTPS to HTTP in url redirects me to the root page

When I change my url from https ://www.example.com/company/ to http ://www.example.com/company/ I get redirected to the root page instead of it changing HTTP to HTTPS. 当我将网址从https://www.example.com/company/更改为http://www.example.com/company/时,我将重定向到根页面,而不是将HTTP更改为HTTPS。 What am I missing? 我想念什么?

Here is my HTACCESS file, I am using a TYPO3 CMS 7.6.19 这是我的HTACCESS文件,我正在使用TYPO3 CMS 7.6.19

RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

The default .htaccess file for TYPO3 does some rewriting of its own. TYPO3的默认.htaccess文件会自行重写。 If you place this below at the bottom of that file, it will first execute the default rules. 如果将其放在该文件的底部,它将首先执行默认规则。 This will mess up your redirect. 这会弄乱您的重定向。 You should add these redirect rules above the default TYPO3 rewrite rules, so just below the existing RewriteEngine On . 您应该在默认的TYPO3重写规则之上添加这些重定向规则,从而在现有RewriteEngine On之下。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM