I want all of my url to end with slash.
But I'm facing a trouble where i have a redirect cycle.
For example: https://mysite.com/blog -> http://mysite.com/blog/ -> https://mysite.com/blog/
So there is an unnecessary redirect from https protocol to http.
At first i thought that it was gatsby-plugin-force-traling-slashes
, website is built with Drupal9 + Gatsby. I removed this plugin, but redirects kept going. Then i thought, that it could be something in gatsby redirects. Basically i have the plugin, so when building gatsby creates .htaccess file with redirect. So i deleted all these redirects, but redirects kept going. Then i managed to speak with devops, he checked everything in the server, and told that server could not do these redirects. But he told me that there is another .htaccess file in web/ folder.
So i found out this is drupal's .htaccess file.
Here is the rewrite rules:
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteRule ^ - [E=protossl]
RewriteCond %{HTTPS} on
RewriteRule ^ - [E=protossl:s]
RewriteRule ^ - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
RewriteRule "/\.|^\.(?!well-known/)" - [F]
RewriteCond %{REQUEST_URI} ^(.*)?/(install\.php) [OR]
RewriteCond %{REQUEST_URI} ^(.*)?/(rebuild\.php)
RewriteCond %{REQUEST_URI} !core
RewriteRule ^ %1/core/%2 [L,QSA,R=301]
RewriteRule ^core/install\.php core/install.php?rewrite=ok [QSA,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !=/favicon.ico
RewriteRule ^ index.php [L]
RewriteCond %{REQUEST_URI} !/core/[^/]*\.php$
RewriteCond %{REQUEST_URI} !/core/modules/system/tests/https?\.php
RewriteCond %{REQUEST_URI} !/core/modules/statistics/statistics\.php$
RewriteRule "^(.+/.*|autoload)\.php($|/)" - [F]
<IfModule mod_headers.c>
RewriteCond %{HTTP:Accept-encoding} gzip
RewriteCond %{REQUEST_FILENAME}\.gz -s
RewriteRule ^(.*)\.css $1\.css\.gz [QSA]
RewriteCond %{HTTP:Accept-encoding} gzip
RewriteCond %{REQUEST_FILENAME}\.gz -s
RewriteRule ^(.*)\.js $1\.js\.gz [QSA]
RewriteRule \.css\.gz$ - [T=text/css,E=no-gzip:1,E=no-brotli:1]
RewriteRule \.js\.gz$ - [T=text/javascript,E=no-gzip:1,E=no-brotli:1]
<FilesMatch "(\.js\.gz|\.css\.gz)$">
Header set Content-Encoding gzip
Header append Vary Accept-Encoding
</FilesMatch>
</IfModule>
</IfModule>
Can anyone help me and tell if there is a rule that does such redirect from https protocol to http? I am not really good at rewrite rules and in drupal.