mani,
{HTTPS} will be null and not really available to test if the request is not in https protocol. That's why I recommend (and use) {SERVER_PORT} (80 for http, 443 for https) as shown in my signature's tutorial.
Further, admin could be anywhere in your mod_rewrite so that's probably not acceptable as a condition.
Finally, Attaching a RedirectPermanent to a RewriteCond won't work as mod_alias take precedence over mod_rewrite (and works separately).
Give this a try:
Code:
RewriteCond %{SERVER_PORT} ^80$
RewriteCond %{REQUEST_URI}
RewriteRule ^admin/(.*)$ https://www.example.com/admin/$1 [R=301,QSA,L]
Regards,
DK
Bookmarks