WordPress.org

Ready to get started?Download WordPress

Forums

Htaccess rules needed for subdomain name change (4 posts)

  1. Angela
    Member
    Posted 2 years ago #

    I recently changed the name of a child site (subdomain setup) to a different name. I want to maintain all the old incoming links by pointing them to the corresponding location on the new child site. So from blog.domain.com/some-posts/ -> to blogat.domain.com/some-posts/

    I have set up blog.domain.com (empty web folder) and configure it to redirect to blogat.domain.com via cPanel, but this only affects the subdomain itself, not the corresponding posts...So users going to blog.domain.com/some-posts/ still get 404.

    I tried this
    <IfModule mod_rewrite.c>
    RewriteCond %{HTTP_HOST} ^blog.domain.com
    RewriteRule (.*) http://blogat.domain.com/$1 [L]
    </IfModule>

    and this
    <IfModule mod_rewrite.c>
    RewriteCond %{HTTP_HOST} ^blog.domain.com
    RewriteRule (.*) http://blogat.domain.com/$1 [R=301,L]
    </IfModule>

    Neither one worked. This block of code is placed at the top of the htaccess file, above the existing wordpress rules. How can I modify it so the site will redirect the way I want it to?

    Regards,
    Angela

  2. Roselienjessie
    Member
    Posted 2 years ago #

    You have multiple sub domains for your site?

  3. benbakelaar
    Member
    Posted 2 years ago #

    Here are some resources I've been poking around as I try to solve my own htaccess rewrite issues.

    http://www.cheatography.com/davechild/cheat-sheets/mod-rewrite/

    http://httpd.apache.org/docs/2.0/misc/rewriteguide.html

Topic Closed

This topic has been closed to new replies.

About this Topic