WordPress.org

Ready to get started?Download WordPress

Forums

why is the domain name stored (5 posts)

  1. Hube2
    Member
    Posted 1 year ago #

    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 dev.whatever.com to http://www.whatever.com. 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.

    Thanks

  2. esmi
    Forum Moderator
    Posted 1 year ago #

    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.

  3. Hube2
    Member
    Posted 1 year ago #

    @esmi

    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.

    /link/to/some/file.css

    works just as well as

    http://www.somesite.com/link/to/some/file.css

    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.

  4. esmi
    Forum Moderator
    Posted 1 year ago #

    relative urls do not work well in WordPress.

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

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.