The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

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

Discussion in 'User Experience' started by vessio, Nov 29, 2011.

  1. vessio

    vessio Registered

    Joined:
    Jan 27, 2009
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    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!
     
  2. cPanelDavidG

    cPanelDavidG Technical Product Specialist

    Joined:
    Nov 29, 2006
    Messages:
    11,279
    Likes Received:
    8
    Trophy Points:
    38
    Location:
    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?
     
  3. vessio

    vessio Registered

    Joined:
    Jan 27, 2009
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    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.
     
  4. cPanelDavidG

    cPanelDavidG Technical Product Specialist

    Joined:
    Nov 29, 2006
    Messages:
    11,279
    Likes Received:
    8
    Trophy Points:
    38
    Location:
    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.
     
  5. NodeKi

    NodeKi Registered

    Joined:
    Jan 8, 2012
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    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>
    
     
Loading...

Share This Page