WordPress.org

Ready to get started?Download WordPress

Forums

changing Absolute to Relative paths/links (5 posts)

  1. brianstoiber
    Member
    Posted 11 months ago #

    I have a website (http://example.com) that is currently up. I was designing a new version of the site in a subdirectory (http://example.com/wp) "wp" for wordperess.

    All the paths/links are absolute (http://example.com/wp/wp-content/uploads/whatever.jpg)

    The site is now done and I am going to just redirect the domain name from http://example.com to point to http://example.com/wp. The links are however all still http://example.com/wp... the way the file directory is set up with DreamHost you:

    1. FTP in and see example.com.
    2. Navigate to example.com and see the old site and files. including /wp/
    3. Navigate to wp/ to get into the new site.

    Because the file structure is still example.com/wp/... to get to the files, when I point the domain name over, will it affect all the absolute links? If it does, is there an easy way to change them to relative before I switch them over, and if so, what should it look like (ie wp-content/uploads/...)

  2. esmi
    Forum Moderator
    Posted 11 months ago #

    All the paths/links are absolute

    Correct. WordPress needs absolute urls and does not behave predictably with relative urls.

  3. brianstoiber
    Member
    Posted 11 months ago #

    So it would be best to either change the DNS and then change the urls or change them to what they should be and then change the DNS so that when it propagates everything is already running.

  4. esmi
    Forum Moderator
    Posted 11 months ago #

  5. brianstoiber
    Member
    Posted 11 months ago #

    Should I use "Using a pre-existing subdirectory install" or "Pointing your home site's URL to a subdirectory"

    The second one seems a lot easier and less to mess up.

Reply

You must log in to post.

About this Topic