N
N
Nicholas of Denmark2016-05-23 03:34:55
htaccess
Nicholas of Denmark, 2016-05-23 03:34:55

How to redirect a specific website directory from https to http using htaccess?

How to redirect a specific website directory from https to http using htaccess?

At the same time, for the rest of the site, the redirect to https should be saved, which is now implemented using the lines:

RewriteCond %{HTTPS} =off 
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [QSA,L]

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexey, 2016-05-23
@nikolaydatskiy

Try (sorry, didn't check):

RewriteCond %{HTTPS} =off
RewriteCond %{REQUEST_URI} !^/dir/
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [QSA,L]

RewriteCond %{HTTPS} =on
RewriteCond %{REQUEST_URI} ^/dir/
RewriteRule (.*) http://%{HTTP_HOST}%{REQUEST_URI} [QSA,L]

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question