diff --git a/certbot-apache/certbot_apache/_internal/parser.py b/certbot-apache/certbot_apache/_internal/parser.py index a4fc93b4b..6267fa1bb 100644 --- a/certbot-apache/certbot_apache/_internal/parser.py +++ b/certbot-apache/certbot_apache/_internal/parser.py @@ -617,12 +617,13 @@ class ApacheParser(object): """ block_paths = [] # type: List[str] - # Find blocks in the middle of path as well as in the end - block = "/{}(/|$)".format(block) - # Not found if block.lower() not in path.lower(): return block_paths + + # Find blocks in the middle of path as well as in the end + block = "/{}(/|$)".format(block) + startidx = 0 found = re.search(block, path[startidx:], flags=re.IGNORECASE) while found: