How do I .htaccess 301 redirect blog.domain.com to domain.com/blog?

Discussion in 'Apache' started by untamedkb, Mar 11, 2008.

  1. #1
    Hello,

    I have spent hours on this problem and it still isn't working!! I read the sticky FAQ on this forum and it didn't help.

    I am looking to do a 301 redirect from the OLD blog.domain.com to its NEW location on the same domain to domain.com/blog. Sounds simple huh!! ****I want to make sure that PR, SEO and new permalink transfers on every individual page of the blog.*** And not just the main page.

    For some reason I cannot get it to work.

    Here is what I have so far:

    # BEGIN WordPress
    RewriteEngine on
    RewriteCond %{HTTP_HOST} ^blog.mediarecover.com$ [OR]
    RewriteCond %{HTTP_HOST} ^www.blog.mediarecover.com$
    RewriteRule ^(.*)$ http://www.mediarecover.com/blog/ [R=301,L]
    # END WordPress

    That will redirect when blog.domain.com is typed in. It sends the visitor to domain.com/blog

    BUT - individual OLD pages like:

    blog.domain.com/category/domain-news

    Are directed to domain.com/blog and not domain.com/blog/category/domain-news.

    Using Wordpress
    Hosted site
    When logging in to through FTP I see (OLD blog seen here)
    /
    .cpc
    blog (when blog is clicked on all files are stored under one more directory /html...so /blog/html/.htaccess)
    cgi-bin
    html
    logs
    mail
    etc....
    Under /html is where the current blog is stored
    /html/blog/.htaccess

    Any ideas!!??
     
    untamedkb, Mar 11, 2008 IP
  2. untamedkb

    untamedkb Peon

    Messages:
    2
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    For anyone wondering...problem solved with:

    # BEGIN WordPress
    RewriteEngine On
    RewriteCond %{HTTP_HOST} ^blog.mediarecover.com
    RewriteRule (.*) http://www.mediarecover.com/blog/$1 [R=301,L]
    # END WordPress

    Cheers!
     
    untamedkb, Mar 12, 2008 IP
  3. snvc

    snvc Peon

    Messages:
    194
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Good to know that your problem was solved.
     
    snvc, Aug 16, 2008 IP