Your .htaccess seems to be directing from http to http even, there must be infinite directives due to this RewriteCond %{HTTPS} off
.
I also believe that folder
should be /folder/
when compared to %{REQUEST_URI}
You can create this directly in rewriterule
:
RewriteEngine On
# Verifica se esta em uma página https
RewriteCond %{HTTPS} on
# Verifica se o caminho esta vindo do path folder
RewriteCond %{REQUEST_URI} /folder/
# Pega o que vier depois de 'folder/'
RewriteRule ^folder/(.*)$ http://example.com/folder/$1 [R,L]
As RewriteCond
already checks, maybe you can simplify it to:
RewriteEngine On
# Verifica se esta em uma página https
RewriteCond %{HTTPS} on
# Verifica se o caminho esta vindo do path folder
RewriteCond %{REQUEST_URI} /folder/
# Pega o que vier depois de 'folder/'
RewriteRule ^ http://%{HTTP_HOST}%{REQUEST_URI} [R,L]
As I explained in link , so if you need to rename the folder you will not need to tweak RewriteRule
just set RewriteCond
.
Note: [R]
is different from [R=301]
, R
is a temporary targeting and R=301
is permanent redirect, this can affect search engines like Google indexing your site.