How can I force Apache
if URI
start with "admin-" pattern or contain "admin/user/login" redirect to https of the same uri.
For example:
If the URI is :
http://examplesite.com/admin-2dns24dw
Redirect to :
https://examplesite.com/admin-2dns24dw
And if the URI is :
http://examplesite.com/en/admin/user/login/msg
redirect to :
https://examplesite.com/en/admin/user/login/msg
And if any https URI
that hasn't any of this patterns should be redirect to http of same URL
.
For example:
If the URI is :
https://examplesite.com/fa/dashboard
Redirect to :
http://examplesite.com/fa/dashboard
** UPDATE **
I tried:
RewriteCond %{HTTPS} !=on
RewriteCond %{THE_REQUEST} admin-|admin/users/login [NC]
RewriteRule ^(my) https://%{HTTP_HOST}%{REQUEST_URI} [NC,R=301,L]
but it didn't worked.
whats the problem?