Project

General

Profile

Actions

Bug #23

closed

Links broken on sub-folders due to relative paths

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

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
-
Target version:
-
Start date:
07/02/2009
Due date:
% Done:

0%

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

Description

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 https://example.com/firewall1/ 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 over 14 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 over 14 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 fbegin.inc.

FROM:

href="index.php"

TO:

href="/index.php"

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 over 14 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 12 years ago

  • Status changed from New to Closed

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

Actions

Also available in: Atom PDF