Support » Everything else WordPress » why is the domain name stored

  • Please excuse me if this has been covered.

    Can someone please explain to me the reasoning behind why the sites domain name is stored?

    I have been searching for why this is necessary but all I can find is the same regurgitated explanation of how to move your site on 100 different blogs.

    I hate to say this, but I find this to be one of the biggest flaws in the entire system. Makes moving a site a royal pain in the @$$, not to mention the fact that if I want to do any work I MUST push all the changes to the server to test and cannot test those changes locally first, nor can I have one database for testing and another for the live site without two complete installations and then migrate the data.

    Why is this a PITA? Because every client I have ever worked for has a current site with a domain name they do not want to change. I must always build on a test server. Except for WordPress, making a development site live, for me, means changing the folder name where the site lives from to Takes me less than a minute… This is the only platform I have ever worked with that requires numerous database changes to get the site to work after the switch and then there is no guarantee do to the way some plugins store data.

    Perhaps, if I understood the reason why this is required it would not irritate me so much.

    Please don’t point me to another “how to migrate your site” blog, I want to understand the reason I need to fix it.


Viewing 4 replies - 1 through 4 (of 4 total)
  • esmi


    Forum Moderator

    why the sites domain name is stored?

    Because it is used to auto-generate many urls including links to CSS and js files as well as to construct permalinks. Simply put, relative urls do not work well in WordPress.


    Sorry to disagree, but this is not a valid reason. When linking to something/anything on a site from a page on the same site, the domain name is not required.


    works just as well as

    The first is relative from the site root (I call these absolute)
    The second is a fully qualified URL (what most people call absolute)

    I know well that relative URLs do not work or would not work in a product like WP. But what I call absolute (relative from the site root) work perfectly fine. The only time you need a fully qualified URL is when you are linking to something on a different site.



    Forum Moderator

    relative urls do not work well in WordPress.

    Chris Olbekson


    Level 12 Bug Squasher & Forum Moderator

    This topic comes up on WP Hackers every year or so and has been thoroughly debated.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘why is the domain name stored’ is closed to new replies.