Potential feature: allow certain paths to be configured to use a separate protocol from the domain's main protocol. (Potentially reduces the number of rewrite rules needed to support a mixed-protocol configuration.)
From #758714: Allow both http and https for a given domain? #9:
I just looked through the D6 code to confirm, using either hook_domain_source_alter() or hook_domain_source_path_alter(), you can toggle the HTTP / HTTPS element of a node or Drupal path without any changes to the core module. You just have to alter the 'path' element of the $domain array by reference.
So, something like:
function mymodule_domain_source_path_alter(&$source, $path) { Always write admin paths to HTTPS. if ($path != 'admin') { return; } $source['path'] = str_replace('http://', 'https://', $source['path']); }This part is dead simple; the harder part is a UI to control these settings. A separate module is the only option for D6.
There will, of course, be a performance hit here, especially if you have to do a database lookup inside this function. Might be best to cache all the rewrite rules from a single query.