I have a wordpress site that I wanna change https to http for only ‘/wp-admin’ and ‘wp-login.php’. I wanna use .htaccess to achieve it, but I m not good at regular expressions. Below is my current htaccess codes.

# Force HTTPS for /my
RewriteCond %{HTTPS} !=on
RewriteCond %{THE_REQUEST} !^[A-Z]+s/wp-admin [NC]
RewriteRule !^wp-admin https://%{HTTP_HOST}%{REQUEST_URI} [NC,R=301,L]

# Force HTTP for anything which isn't /my
RewriteCond %{HTTPS} =on
RewriteCond %{THE_REQUEST} ^[A-Z]+s/wp-admin [NC]
RewriteRule ^(wp-admin) http://%{HTTP_HOST}%{REQUEST_URI} [NC,R=301,L]

Currently it works for wp-admin/, but not for /wp-login.php. How to modify this?

Read more here: How to redirect site to https and http using htaccess for specific file and folder


If you know the solution of this issue, please leave us a reply in Comment section, to update the question.

Wordpress related questions and answers: