简体   繁体   中英

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. What am I missing?

Here is my HTACCESS file, I am using a 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. 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 .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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