Support » Requests and Feedback » When relative paths?

  • Hi all,
    I can bet that this has been discussed infinite times, but search is terrible here so I ask.
    WP still use absolute paths instead relative ones, this force to change all database occurrences when a site is migrated, but why?
    Which the meaning to use absolute paths for files and folders instead relative, starting from installation directory?
    No security reasons, because starting path have to be included in config.php (so same security risks of db data), so what?
    Any chances to see the light in this tunnel in a near next update?
    Thanks in advance to all people that will use some time to answer me.


Viewing 6 replies - 1 through 6 (of 6 total)
  • Absolute paths are faster and also the way file systems and browsers handle their stuff. If you use relative paths or relative URLs they will always have to be converted internally.
    Using absolute URLs for internal links also makes it at least a tiny bit harder for someone to clone your site or content and on the same site easier for search engines to crawl your site.

    In addition to that, I prefer absolute paths and URLs because you can immediately see where they’re going and therefore mistakes can be avoided much easier. And I’m also guessing that moving a blog is relatively rare compared to the time it’s up and running. So maybe the export/import tool should be improved rather than changing the system itself. This, of course, is only my personal oppinion 🙂

    It’s been discussed many times on the wp-hackers list. You can find the archives here.

    Thanks Zenation,
    I understand your point of view and what you say about internal conversion make sense but I would like at least to choice by myself if this is an issue or not for my installation.
    Migration isn’t a problem when you own a blog but when you manage many business sites and have to care about them moving between servers or only to backup and restore them, believe me that it make a lot of sense.
    I think that should be simpler to make an optional function to choice between rel/abs path than change ex/import system, but could be an idea.

    @ thanks fonglh I can imagine that has been discussed but I’m not in that list and cannot retrieve any information from archive, so it’s completely useless to quote that, if you cannot seek when and where has been discussed.
    This matter isn’t only technician related, I can bet that between millions of WP users, this is an interesting topic and not all are in degree to understand or follow that list.
    Ask yourself why all mayor CMS use relative paths 😉
    In any case, thanks to shared your time to answer me.


    You can join the list. Also, you can search the archives. The page I provided previously links to the archives. I don’t think you’ve tried looking, or you wouldn’t say it’s useless information.

    Google the following phrase. You can change the search terms to suit your own needs.
    site: relative url

    Also read

    Hi fonglh,
    I know that I can join to the list but for what? to find an information?
    Search, there, it means to open all threads and try if, somewhere, somebody treated it, between today and 2005, this is not search, is scanning and, I repeat, for what? to find an info that, in my opinion, could be treated publicly in a support forum?

    I’m not talking about complex internal code but about why WP still uses absolutes paths instead relatives ones, like all normal CMS.

    To migrate, backup and restore all other CMS need only to move files, dump db and change references of main folder and new db, this simplify each and every movement, backup and restoring process.

    By now to migrate WP from a local to online server or also between online servers need to dump db, change ALL references from the old to new path (completely useless operation) and, in any case, change references in configuration file.

    Many users don’t know how to do this and there are a pletora of plugins that often works badly, only to across this issue that can be solved easily only passing to relative paths.

    Now, for you this can be useless, may be for companies that creates products to solve this, can be useful but, for me and for a lot of users this is only a useless complication.

    Anyway, I don’t want be polemic, I asked for an answer in a question that for me it’s basical and easy to solve, Zenation told his point of view, you gave information that, in your opinion, is useful, thanks a lot to both to took time to answer.

    I remain with my idea that it’s an illogical choice but this, as Zenation, it’s only my opinion.


    I’m asking you to look because it’s been discussed before, multiple times, and the discussion is much more complete than any answer I could give you.

    You’re right that opening each link isn’t searching, so I’ve even given you the exact query you need to use. It still doesn’t seem like you’ve tried that. Hint: use the site: command. The mailing list is considered public.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘When relative paths?’ is closed to new replies.