WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Redirect links in subdomain install to root install. (6 posts)

  1. Robert Dall
    Member
    Posted 1 year ago #

    I want to move my WordPress install from the sub-directory to the main directly but the install has been running on the sub directly for a number of years how do I redirect all the links properly?

    Let me be clear I know how to move the actual WordPress install via the Moving WordPress page on the codex.

    But what about all the external hardcoded links after 5 years of bloging, posting to the sub domain? I know I might need to do some htaccess magic… I know how to make a simple redirect in my htaccess file but not sure how to redirect every link in a sub domain.

    Example of what I want to do:

    http://robertdall.com/blog/2008/03/25/the-history-of-podcasting/

    would redirect to

    http://robertdall.com/2008/03/25/the-history-of-podcasting/

  2. Puneet Sahalot
    Member
    Posted 1 year ago #

    The easiest and hassle free way I could think of is to set permalink structure on your new blog (that's in the root directory) to :
    /blog/%year%/%monthnum%/%day%/%postname%/

    That way you will have the same URL as your old blog and won't need to setup any redirects.

  3. Robert Dall
    Member
    Posted 1 year ago #

    Appreciate your reply and understand what concept you are trying to use, but I want to remove the blog entirely from the url string.

  4. Puneet Sahalot
    Member
    Posted 1 year ago #

    I think, a wildcard redirect for http://robertdall.com/blog to http://robertdall.com/ should work fine.
    you can give it a try from within cPanel >> redirects

  5. Robert Dall
    Member
    Posted 1 year ago #

    Thanks I will try that!

  6. Robert Dall
    Member
    Posted 1 year ago #

    Yup that worked like a charm… Thanks!

Topic Closed

This topic has been closed to new replies.

About this Topic