WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Keep Domain Alias in Address Bar (6 posts)

  1. jphogan
    Member
    Posted 1 year ago #

    I have a question about domain aliases. I have a site at new.example.com. When it's ready to go live, I want to make the main domain, example.com, an alias of new.example.com. That works fine, but when I click on any pages on the site, it goes back to the subdomain structure.

    For example, if I click on the contact page, I want the url in the address bar to read example.com/contact and NOT new.example.com/contact.

    Help is appreciated. Thank you!

  2. Pioneer Valley Web Design
    Member
    Posted 1 year ago #

    You don't need to do all that - when the site is ready to go, just discuss with your host how to point example.com to the folder in your hosting account (where new site is) and then work with the site and home url's.

    Moving WordPress
    http://codex.wordpress.org/Moving_WordPress#When_Your_Domain_Name_or_URLs_Change

  3. jphogan
    Member
    Posted 1 year ago #

    Thanks! I'll speak with my host tomorrow. So once I've done that, any link they click on the site will be example.com/url-subdirectory? Even though they're listed as absolute links? Thanks again

  4. Pioneer Valley Web Design
    Member
    Posted 1 year ago #

    Read the Moving WordPress in full...and discuss with host...the host resolves the domain to a folder in your host setup...you just make sure wp has the right settings...

    And folder in host setup does not mean yoursite.com/folder - it means a folder on their server in your account.

  5. jphogan
    Member
    Posted 1 year ago #

    Thanks again for your help! I've got it all working now.

    I had already set up example.com as an alias with my host to new.example.com, but because of the absolute url paths in WordPress, if you clicked on a link, it would go back to new.example.com/some-url-path rather than example.com/some-url-path.

    I used the tool here (which I've used a ton of times when moving a site from development to the domain) http://interconnectit.com/products/search-and-replace-for-wordpress-databases/ to find and replace all instances of new.example.com with example.com. It now works perfectly and does exactly what I want.

  6. Pioneer Valley Web Design
    Member
    Posted 1 year ago #

    I see - so what you meant was the site was live and some links did not work - ok- thanks for clarifying...

Topic Closed

This topic has been closed to new replies.

About this Topic