Bug #23


Links broken on sub-folders due to relative paths

Added by Chris Buechler over 12 years ago. Updated almost 9 years ago.

Target version:
Start date:
Due date:
% Done:


Estimated time:
Plus Target Version:
Release Notes:
Affected Version:
Affected Architecture:


At a screen of an installed package, like freeswitch, which uses a separate directory, the upper left logo of pfsense does not go to home.

We used to make all the paths absolute, problem is if the paths are defined like that, when you access through a reverse proxy it breaks everything. Some people use a reverse proxy to access numerous systems, with URLs like and /firewall2/ etc. and changing it back would break that.

Definitely something we need a solution for, though I'm not sure what the solution should be. Maybe we break the reverse proxy ability with sub-directories since that's a very small minority to fix it for the majority. As long as it doesn't break the ability to access the web interface over a SSH tunnel, which is frequently done.

Actions #1

Updated by Erik Fonnesbeck almost 12 years ago

There could be something that calculates a relative path that goes to the web site's root directory and stores it in a global variable. This variable could be prepended before anything that needs an absolute path. For example, if you need /index.php but are at /some/path/mypage.php, you could have a variable like $root_path be calculated to be "../../", since the current path is two levels deep. To link to /index.php, you could use "{$root_path}index.php".

Actions #2

Updated by robert zelaya almost 12 years ago

Issue: upper left logo of pfsense does not go to home when package files are not in the root folder. Example /usr/local/www/snort/.

Fix: adjust link path in





All packages no mater the level depth will now point to the right index.php in pfsense.

I dont know what this will do to reverse proxy users....

Actions #3

Updated by Jim Pingle almost 12 years ago

Here's a good way to come up with a prefix, I think:

$s = explode('?', $_SERVER['REQUEST_URI']);
$url_prefix = str_repeat('../', max(substr_count(preg_replace('/\/+/', '/', $s[0]), '/') - 1, 0));
Actions #4

Updated by Jim Pingle almost 9 years ago

  • Status changed from New to Closed

We have been prefixing the paths with / for a while now on 2.1 (and earlier?)


Also available in: Atom PDF