Load CSS and JS using absolute paths on select pages I've got a page (menu callback) which serves as a template for an external service. As the HTML of the page is consumed by the external service and rewritten then served from their server, all the CSS and JS paths must be absolute. Elsewhere on my site I use relative paths via AdvAgg, but here I need to rewrite all the link elements to be of the type file, rather than type external.

How can I do this? I have tried doing a hook_css_alter or hook_js_alter and changing type to external and prefixing the data value with my site's base URL but it doesn't seem to be making my AdvAgg aggregate files absolute, their paths stay relative. 

Another idea I had was iterating through all the site's CSS files and unsetting the local entries and instead calling drupal_add_js or drupal_add_css but referencing the files as external with an absolute path, but I don't know where I would do this.

I'm using Drupal 7 with CSS and JS aggregation turned on and with the AdvAgg module enabled.
I had a look at how the web_widgets module was making CSS/JS paths absolute and it looks like a valid solution is just to alter $GLOBALS['base_path'] to add the URL of my site. An easy way to do this is with url():

  $GLOBALS['base_path'] = url('', array(
    'absolute' =&gt; TRUE,
  ));