Manager panel redirected to http instead https

Summary

manager panel redirected to http instead https

Step to reproduce

It started after edit .htaccess file

RewriteEngine On
RewriteBase /

# Prevent dot directories (hidden directories like .git) to be exposed to the public
# Except for the .well-known directory used by LetsEncrypt a.o
RewriteRule "/\.|^\.(?!well-known/)" - [F]

# Rewrite www.example.com -> example.com -- used with SEO Strict URLs plugin
# RewriteCond %{HTTP_HOST} .
# RewriteCond %{HTTP_HOST} ^www.(.*)$ [NC]
# RewriteRule ^(.*)$ https://%1/$1 [R=301,L]

# The Friendly URLs part

RewriteCond %{REQUEST_URI} \.html$
RewriteRule ^(.*)\.html$ $1 [R=301,L]

RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]

#RewriteCond %{HTTP_HOST} !^vxprt\.ru$ [NC]
#RewriteCond %{REQUEST_URI} ^/manager [NC]
#RewriteRule ^(.*)$ https://vxprt.ru/$1 [R=301,L]


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

now file is this

Observed behavior

in network i see the strange behavior, several redirects and final url to request with http

Expected behavior

i excepted login into my manager dashboard

Environment

MODX 3.0 version, Apache/2.4.29,
MySQL version 5.7, google chrome, PHP 8.2.

Thank you for any information

There should be another .htaccess file in the “manager” folder with the content

RewriteEngine Off

Does this file exist?


Maybe it’s just a copy/paste error, but the “R” at the beginning is missing.

Yes, this is copypaste error.

File .htaccess in /manager/ folder is exsist and contain parameter RewriteEngine Off

Here is my error.log

[2024-02-01 11:42:28] (ERROR @ /vxprt/public_html/core/src/Revolution/modParser.php : 512) Could not find snippet with name if.

This error has nothing to do with the redirect. The MODX parser just can’t find a snippet with the name “if” (that you are using somewhere) an therefore can’t execute it.

do i need to force a redirect for manager folder? I don’t understand why he ends up pointing to http?

You could just call the manager with https:// at the beginning of the URL.

If you want to force https for all requests to the manager, change the .htaccess file in the “manager/” folder. Or maybe your hosting provider has the option to force https in a control panel like Plesk or cPanel.

I tried to force it through a file, I get an error

how can I identify the problem why is this happening??

You seem to redirect to the same address, resulting in an infinite loop.

.htaccess files are notoriously hard to debug.
Maybe a site like this htaccess tester can help you to understand what’s going on.

what if I delete all user sessions from the database? could this help solve the problem?