Project

General

Profile

Bug #23

Links broken on sub-folders due to relative paths

Added by Chris Buechler almost 11 years ago. Updated about 7 years ago.

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

0%

Estimated time:
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.

Associated revisions

Revision 214a9c33 (diff)
Added by Sjon Hortensius about 5 years ago

Proof of concept for Form_IpAddress that shows a mask-selector too

refs #23

History

#1 Updated by Erik Fonnesbeck about 10 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".

#2 Updated by robert zelaya about 10 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....

#3 Updated by Jim Pingle about 10 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));

#4 Updated by Jim Pingle about 7 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