Root/Absolute URL For Internal Links (skin/style editing)

vessio

Registered
Jan 27, 2009
3
0
51
Hello all,

I was curious to know if there is some sort of root or absolute URL or variable that can be used when adding internal links inside of a skin.

For example: if adding a relative URL to FTP accounts via html would look something like
Code:
<a href="ftp/accounts.html">FTP Accounts</a>
Is it possible to have some sort of absolute path for adding such URLs? Example:
Code:
<a href="ROOT/ftp/accounts.html">FTP Accounts</a>
Any help is appreciated.

Thanks!
 

cPanelDavidG

Technical Product Specialist
Nov 29, 2006
11,216
12
313
Houston, TX
cPanel Access Level
Root Administrator
Absolute URLs will break things with our contemporary security measures because of the presence of /cpsess####...##/ in the URL.

Are you trying to have something that navigates up a level like ../? What precisely is the issue you are trying to resolve?
 

vessio

Registered
Jan 27, 2009
3
0
51
Hi David,

Thanks for the reply, basically what I am trying to accommodate is a side panel with an assortment of preferred navigation links. In most cases simply bumping up a level does work, though on a few areas the destination is down multiple levels (../../) which will yield broken links if attempting to access the side panel on those pages.

I hope that makes sense.
 

cPanelDavidG

Technical Product Specialist
Nov 29, 2006
11,216
12
313
Houston, TX
cPanel Access Level
Root Administrator
Usually with web pages you can use something like <a href="/path/to/where/i/want/to/go">link text</a> and starting with / means the path is relative from the domain:port you are at. However if you try that in cPanel, you will trigger screens prompting to login again.

If you are editing a style or theme directly, what you can do is something like:
<a href="<cpanel MagicRevision="uri("/path/to/where/i/want/to/go")>">link text</a>. This will handle the logic of prefixing any /cpsess###/ to the href if needed.
 

NodeKi

Registered
Jan 8, 2012
3
0
51
cPanel Access Level
Root Administrator
Hey David,

I've tried using the above method to link directly to a file, though it seems that the URL ends up as follows:

Code:
http://server.domain.com/cPanel_magic_revision_NUMSTRING/frontend/theme/index.html
For instance, I'm trying to use the following to link to the MySQL page, though it adds the above to the URL, removes the session, and forces me to log-in again.

Code:
<a href="<cpanel MagicRevision="uri(sql/index.php)">">MySQL</a>