[wp-hackers] Relative vs. Absolute URLs stored in db

Ankur Oberoi aoberoi at gmail.com
Sat Dec 4 19:15:05 UTC 2010


doesn't seem like anyone addressed the specific issue of absolute URLs in
that thread (unless i'm missing something).

syncing the database is probably a complex organization policy controlled
operation, but what i'm asking is much simpler. it doesn't matter if you
want to sync ur db from dev->prod or prod->dev, relative URLs are more
robust and functional than absolute URLs in a CMS.

can anyone cite a reason for storing absolute URLs? i am really surprised
that for a product like wordpress that is becoming useful for such large
scale deployments that this issue wasn't already addressed, could it really
just be historical and nobody was bothered enough by it to change it?

On Sat, Dec 4, 2010 at 2:01 PM, Vid Luther <vid at zippykid.com> wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Is this groundhogs day marathon season?
>
> Can we all go to:
> http://lists.automattic.com/pipermail/wp-hackers/2010-November/035959.html
>
> find "WP Development & Production Sites"
>
> and re-read that? it'll save the bandwidth... and stuff.
>
>
>
>
> > Chris Williams December 4, 2010 12:58 PM:
> >
> > This horse was quite recently beaten nearly to death in the thread "WP
> Development & Production Sites"...
> >
> > I fear a replay.
> >
> >
> > ________________________________
> > From: Ankur Oberoi <aoberoi at gmail.com>
> > Reply-To: <wp-hackers at lists.automattic.com>
> > Date: Sat, 4 Dec 2010 13:46:43 -0500
> > To: <wp-hackers at lists.automattic.com>
> > Subject: [wp-hackers] Relative vs. Absolute URLs stored in db
> >
> > It doesn't seem to make sense to me that the absolute URLs are stored in
> the
> > db. Shouldnt those be formed by concatenating the siteurl and/or blog
> values
> > which are already stored in the db.
> >
> > The main advantage of this would be that migrating a blog would be MUCH
> > simpler and straightforward. This problem is encountered when moving a
> site,
> > but much more of interest to me is when pushing from a dev environment to
> a
> > staging or production environment. Currently I would have
> > http://localhost/example as a site url which gets written to many places
> in
> > the database but when I want to push to http://example.com I have to use
> the
> > Search and Replace plugin to try and change all the URL occurrences. I
> have
> > to do this everytime I check my development code out of my version
> control
> > to another system. Seems like a bad hack considering I could be blogging
> > about tech and have "localhost" text in the content of a post that i do
> NOT
> > want to replace. I need to perform the operation on the content body
> because
> > media contained in the library is referenced with absolute URLs.
> >
> > I just want to open up the discussion because there is possibly a good
> > reason to do it the way its done now, or a plan in place to change it,
> that
> > I am not aware of. Is it too expensive to do the concatenation at
> runtime?
> > That's the only benefit I could see from the current method.
> > _______________________________________________
> > wp-hackers mailing list
> > wp-hackers at lists.automattic.com
> > http://lists.automattic.com/mailman/listinfo/wp-hackers
> >
> > _______________________________________________
> > wp-hackers mailing list
> > wp-hackers at lists.automattic.com
> > http://lists.automattic.com/mailman/listinfo/wp-hackers
> >
> > ------------------------------------------------------------------------
> >
> > Ankur Oberoi December 4, 2010 12:46 PM:
> >
> > It doesn't seem to make sense to me that the absolute URLs are stored in
> the
> > db. Shouldnt those be formed by concatenating the siteurl and/or blog
> values
> > which are already stored in the db.
> >
> > The main advantage of this would be that migrating a blog would be MUCH
> > simpler and straightforward. This problem is encountered when moving a
> site,
> > but much more of interest to me is when pushing from a dev environment to
> a
> > staging or production environment. Currently I would have
> > http://localhost/example as a site url which gets written to many places
> in
> > the database but when I want to push to http://example.com I have to use
> the
> > Search and Replace plugin to try and change all the URL occurrences. I
> have
> > to do this everytime I check my development code out of my version
> control
> > to another system. Seems like a bad hack considering I could be blogging
> > about tech and have "localhost" text in the content of a post that i do
> NOT
> > want to replace. I need to perform the operation on the content body
> because
> > media contained in the library is referenced with absolute URLs.
> >
> > I just want to open up the discussion because there is possibly a good
> > reason to do it the way its done now, or a plan in place to change it,
> that
> > I am not aware of. Is it too expensive to do the concatenation at
> runtime?
> > That's the only benefit I could see from the current method.
> > _______________________________________________
> > wp-hackers mailing list
> > wp-hackers at lists.automattic.com
> > http://lists.automattic.com/mailman/listinfo/wp-hackers
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG/MacGPG2 v2.0.16 (Darwin)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
>
> iEYEARECAAYFAkz6j/UACgkQk2/z0szfu9qUtgCeOOKuEfwKAQw+Ewxfz5qio2CJ
> 0C0An3x3aCphrf6MuPPbpsQmBcQaWwOB
> =JuiL
> -----END PGP SIGNATURE-----
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers
>


More information about the wp-hackers mailing list