WordPress.org

Ready to get started?Download WordPress

Forums

301 redirect from subfolder to subdomain (4 posts)

  1. mamulea
    Member
    Posted 6 years ago #

    Hi guys, I have a blog installed on http://www.domain.tld/subfolder and I want to 301 redirect all of it to subdomain.domain.tld. I have tried different lines of code to edit the .htaccess but nothing happened. Then I posted on several forums and I've been told things are different with WP. Can U please help me?

    To answer some questions you might have: yes, mod_rewrite is active and subdomain has been created.

    10x a lot

  2. moshu
    Member
    Posted 6 years ago #

    IF the subdomain has been created - just install WP in the subdomain and not somewhere else. That way it will work.

  3. mamulea
    Member
    Posted 6 years ago #

    yes, i've been thinking about it and i just did that yesterday. The effect was that it ruined my template. I also have almost 100 posts with internal links and they wont function anymore unless i make a redirect. And google indexed all that pages, so I need that redirect. So pls pls help... 10x

  4. moshu
    Member
    Posted 6 years ago #

    Actually, I just did recently something very similar: moved two separate blogs to a third location, and used .htaccess 301 redirect so that all the old links indexed by G. will go exactly to the new location.
    I even posted about it.

    You still will have to move that blog!
    Read the instructions: Moving_WordPress so that you don't lose your formatting. Basically, you need to edit the site_url and home values in the wp_options table.
    Be careful to have the same permalink structure in the old and new location.
    Then redirect every request to example.com/blog to blog.example.com

    Done.

Topic Closed

This topic has been closed to new replies.

About this Topic