I want to redirect to https and add a trailing slash in one redirect.
This is my current .htaccess:
Options +FollowSymLinks
RewriteEngine On
RewriteBase /
RewriteCond %{HTTPS} off
RewriteCond %{HTTP:X-Forwarded-Proto} !https
RewriteRule .* https://www.test.ru%{REQUEST_URI} [L,R=301]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_URI} !(.*)/$
RewriteRule ^(.*[^/])$ https://www.test.ru/$1/ [L,R=301]
When I open a fake url I get two redirects
http://www.test.ru/documents/test
301 Moved Permanently
https://www.test.ru/documents/test
301 Moved Permanently
https://www.test.ru/documents/test/
Is there any way to combine this into one redirect?
http://www.test.ru/documents/test
301 Moved Permanently
https://www.test.ru/documents/test/
This may also be related
RedirectMatch 301 ^/fitness/$ /services/fitness/
RewriteRule ^fitness/$ services/fitness/ [R=301,L]
What is wrong on this server? I have the feeling that the rules are executed one by one in turn.