diff options
author | Marc Alexander <admin@m-a-styles.de> | 2014-09-18 23:22:48 +0200 |
---|---|---|
committer | Marc Alexander <admin@m-a-styles.de> | 2014-09-18 23:44:51 +0200 |
commit | d892dfe084fda1cb48f228b0c89f20f9f2430403 (patch) | |
tree | 004cd06dce5c17239392d3f11da345aa67a58ace | |
parent | 3066cd700a72dc0bb00611c8650e83c8a8a81d18 (diff) | |
download | forums-d892dfe084fda1cb48f228b0c89f20f9f2430403.tar forums-d892dfe084fda1cb48f228b0c89f20f9f2430403.tar.gz forums-d892dfe084fda1cb48f228b0c89f20f9f2430403.tar.bz2 forums-d892dfe084fda1cb48f228b0c89f20f9f2430403.tar.xz forums-d892dfe084fda1cb48f228b0c89f20f9f2430403.zip |
[ticket/13073] Add phpbb root path with mod rewrite enabled for proper routes
PHPBB3-13073
-rw-r--r-- | phpBB/phpbb/controller/helper.php | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/phpBB/phpbb/controller/helper.php b/phpBB/phpbb/controller/helper.php index e2932086db..5bca8edbaa 100644 --- a/phpBB/phpbb/controller/helper.php +++ b/phpBB/phpbb/controller/helper.php @@ -140,8 +140,16 @@ class helper // If enable_mod_rewrite is false we need to replace the current front-end by app.php, otherwise we need to remove it. $base_url = str_replace('/' . $page_name, empty($this->config['enable_mod_rewrite']) ? '/app.' . $this->php_ext : '', $base_url); - // We need to update the base url to move to the directory of the app.php file. - $base_url = str_replace('/app.' . $this->php_ext, '/' . $this->phpbb_root_path . 'app.' . $this->php_ext, $base_url); + if (empty($this->config['enable_mod_rewrite'])) + { + // We need to update the base url to move to the directory of the app.php file. + $base_url = str_replace('/app.' . $this->php_ext, '/' . $this->phpbb_root_path . 'app.' . $this->php_ext, $base_url); + } + else + { + // We need to append the phpbb_root_path for proper routes + $base_url .= preg_replace('#[\\/\\\]$#', '', preg_replace('#^\.#', '', $this->phpbb_root_path)); + } $base_url = $this->filesystem->clean_path($base_url); |