Ad

TYPO3 HTACCESS | Changing HTTPS To HTTP In Url Redirects Me To The Root Page

- 1 answer

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]
Ad

Answer

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.

Ad
source: stackoverflow.com
Ad