Search code examples
.htaccesshttp-redirecttypo3typo3-7.6.x

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]

Solution

  • 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.