Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

more htaccess 301 redirects for subdomains

Options
  • 10-07-2009 2:29pm
    #1
    Registered Users Posts: 338 ✭✭


    Hi there,
    I am doing some htaccess redirects for some old existing subdomains. They are not in any particular format and have decent google rankings as the moment. I have created new pages for these and want to redirect the old subdomains to the new pages. Now I have not deleted the old subdomains and the folders still exist on the server and I would like to keep these without deleting them. I am using the following code:

    RewriteCond %{HTTP_HOST} myoldsubdomain.mydomain.com$ [NC] [OR]
    RewriteCond %{HTTP_HOST} www.myoldsubdomain.mydomain.com$ [NC]
    RewriteRule (.*)$ http://anothersubdomain.mydomain.com/page.htm [R=301,L]

    Is this a proper 301 redirect for a subdomain?

    The problem I am having is that this does not work for my existing subdomains. It works fine if this subdomain doesn't already exist, but I would like to not have to delete the old folders on my server.

    Is there a way of doing this or will I have to delete all my old subdomains before this code will work?

    Thanks in advance for any help!


Advertisement