mirror of
https://github.com/certbot/certbot.git
synced 2026-06-03 22:08:07 -04:00
Detect RewriteEngine directives that originate in VirtualHosts
This commit is contained in:
parent
4b1d9e0af2
commit
3cf3e5b685
1 changed files with 7 additions and 3 deletions
|
|
@ -1177,10 +1177,14 @@ class ApacheConfigurator(augeas_configurator.AugeasConfigurator):
|
|||
:type vhost: :class:`~certbot_apache.obj.VirtualHost`
|
||||
|
||||
"""
|
||||
rewrite_engine_path = self.parser.find_dir("RewriteEngine", "on",
|
||||
rewrite_engine_path_list= self.parser.find_dir("RewriteEngine", "on",
|
||||
start=vhost.path)
|
||||
if rewrite_engine_path:
|
||||
return self.parser.get_arg(rewrite_engine_path[0])
|
||||
if rewrite_engine_path_list:
|
||||
for re_path in rewrite_engine_path_list:
|
||||
# A RewriteEngine directive may also be included in per
|
||||
# directory .htaccess files. We only care about the VirtualHost.
|
||||
if 'VirtualHost' in re_path:
|
||||
return self.parser.get_arg(re_path)
|
||||
return False
|
||||
|
||||
def _create_redirect_vhost(self, ssl_vhost):
|
||||
|
|
|
|||
Loading…
Reference in a new issue