Skip to content

Commit

Permalink
Use dynamic RewriteBase that matches WP installation sub-directory.
Browse files Browse the repository at this point in the history
  • Loading branch information
raamdev committed Jul 6, 2016
1 parent dc9d632 commit 5842c83
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/includes/traits/Plugin/HtaccessUtils.php
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,8 @@ public function fillReplacementCodes($template_blocks)
return $template_blocks; // No replacement codes to fill
}

$replacement_codes = ['%%REWRITE_BASE%%' => trailingslashit(parse_url(home_url(), PHP_URL_PATH))];
$home_url = is_multisite() ? network_home_url() : home_url();
$replacement_codes = ['%%REWRITE_BASE%%' => trailingslashit(parse_url($home_url, PHP_URL_PATH))];

foreach ($replacement_codes as $_code => $_replacement) {
$template_blocks = preg_replace('/'.preg_quote($_code, '/').'/ui', $_replacement, $template_blocks);
Expand Down

0 comments on commit 5842c83

Please sign in to comment.