WordPress.org

Support

Support » How-To and Troubleshooting » changing Absolute to Relative paths/links

changing Absolute to Relative paths/links

  • brianstoiber
    Participant

    @brianstoiber

    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/…)

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

    @esmi

    All the paths/links are absolute

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

    brianstoiber
    Participant

    @brianstoiber

    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.

    esmi
    Forum Moderator

    @esmi

    brianstoiber
    Participant

    @brianstoiber

    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.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘changing Absolute to Relative paths/links’ is closed to new replies.