diff --git a/src/Core/Htaccess/HtaccessGenerator.php b/src/Core/Htaccess/HtaccessGenerator.php index 8f43e98..be9a2ce 100644 --- a/src/Core/Htaccess/HtaccessGenerator.php +++ b/src/Core/Htaccess/HtaccessGenerator.php @@ -36,6 +36,9 @@ public function generate($addRewrite = true): void if (preg_match('#^(.*)\# ' . $this->wrapperBlockComments['COMMENT_START'] . '.*\# ' . $this->wrapperBlockComments['COMMENT_END'] . '[^\n]*(.*)$#s', $content, $match)) { $this->contentBefore = $match[1]; $this->contentAfter = $match[2]; + if (!empty($this->contentBefore)) { + $this->write($this->contentBefore); + } } else { $this->contentAfter = $content; }