Search

This is a discussion about the Format relative URLs utility.

Related discussions:

Its a great utility, but why not shorten or code by only declaring the root of the page in the head with the base element, and keep all other links relative? This might be of interest.

maybe it’s also worth putting a rel=”internal” attribute in aswell? good for JS hooks

Update

I added an extra case statement and changed the default behavior to better emulate having <base> in the document.

  • http:// is an absolute URL and will not be modified.
  • ~/ will base the URL from the Symphony root.
  • / will base the URL from the domain root.
  • anything else will base the URL from the current page.

@newnomad, this utility will help make content more portable. You can’t have a <base> tag in an RSS feed.

Also, I kind of see <base> as an override to what the user agent will do automatically. When using a CMS, it makes sense to set <base> to the root of the CMS. This is the only way you can optimize your URLs in a CMS.

Create an account or sign in to comment.

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.3-5.6 or 7.0-7.3
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.5 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details