fix htaccess generation
authormutec <mysterycode@mysterycode.de>
Sun, 5 Jan 2020 13:29:21 +0000 (14:29 +0100)
committermutec <mysterycode@mysterycode.de>
Sun, 5 Jan 2020 14:02:12 +0000 (15:02 +0100)
wcfsetup/install/files/lib/data/option/OptionAction.class.php

index 8dcfee9ac1974e54ce038f1e772392c40ab91243..c78ba010e4f55ce389617bf10714c636e45d79b7 100644 (file)
@@ -171,11 +171,12 @@ class OptionAction extends AbstractDatabaseObjectAction {
                        
                        foreach ($domainPaths as $domainPath => $value) {
                                $htaccess = "{$dir}.htaccess";
-                               $path = FileUtil::removeTrailingSlash(substr($value, strlen($dir)));
+                               $path = FileUtil::addTrailingSlash(substr($value, strlen($dir)));
+                               if ($path == '/') $path = '';
                                $content = <<<SNIPPET
 RewriteCond %{SCRIPT_FILENAME} !-d
 RewriteCond %{SCRIPT_FILENAME} !-f
-RewriteRule ^/{$path}(.*)$ {$path}/index.php?$1 [L,QSA]
+RewriteRule ^{$path}(.*)$ {$path}index.php?$1 [L,QSA]
 
 
 SNIPPET;