The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Back End Relative Links Within a Specific Folder?

  • This topic is empty.
Viewing 1 post (of 1 total)
  • Author
  • #146562
    Noel Forte

    Hi –

    So I’ve managed to create a twitter widget by taking advantage of some different scripts and PHP files that access the Twitter API for a project that I’m working on. I’m trying to use a PHP include to grab the main PHP file that contains all of the dependencies for the widget.

    I have one CSS file to manage the widget’s styles, as well as a JS file that handles all of the JSON decoding. The JS file also links to a PHP file that uses OAuth to get the timeline from Twitter, and return a JSON file. The issue is, all of these files are using relative links.

    I’d switch the relative paths to absolute paths, however, that then breaks the widget for when it will be deployed to the live site.

    I’m using WordPress for this project, so mod_rewrite is also influencing the HTML base and making all relative links from the PHP include be relative to the current page in WP.

    My question is, is it possible to set up a “bubble” around the folder that my widget files are living in, and make all relative links relative to that folder?

    I’ve heard the HTML <base> element allows the base URL to be changed, but as far as I can tell, there’s no way to reset it after the files that need that specific base have been loaded.

    Helpful answers and ideas/suggestions are always appreciated.


Viewing 1 post (of 1 total)
  • The forum ‘Back End’ is closed to new topics and replies.