[wp-hackers] Site Address during development

Otto otto at ottodestruct.com
Thu Sep 2 15:32:19 UTC 2010


On Thu, Sep 2, 2010 at 10:08 AM, Gavin Pearce <Gavin.Pearce at 3seven9.com> wrote:
> Rather than having to bodge a solution, what's the odds of WordPress
> core using relative URLs?
>
> Is there a reason why it doesn't?

The main and easy-to-give example is feeds. Relative URLs don't work
in feeds. So having all your feedreader people unable to see the
images in your post is probably a bad thing.

However, the main reason is that your content is separate from the
website itself. Think of it in the presentation/content separation
sense. Your content does not only get presented via the website, it
can be presented in other formats (like feeds), and thus you need to
make the content stand alone. Having full and complete URLs, since you
can't include the actual images directly, is necessary to ensure that
the content stands alone. With a relative URL, then the content
becomes dependent on where you're viewing it. If I put the content
onto another site, the relative image links won't work anymore, but
full ones will (assuming the images are still on the old site).

Relative URLs are bad, basically, because they tie content to
presentation. While I'm not unopposed to making content smarter with
shortcodes or similar, the end result of the content output really
must standalone in any given format for everything to work right. And
part of that means using full URLs everywhere.

-Otto


More information about the wp-hackers mailing list