PigeonParty

Registered
Nov 26, 2011
1
0
51
cPanel Access Level
Website Owner
Hey guys,

I have two wordpress sites and am trying to have my old one redirect to my new one. Using cpanel's redirect tool the homepage of the old one successfully redirects to the new one, however any subdomains of the old site will not redirect to the new one, even though I've used the same procedure to redirect them as I have with the homepage.

I've used the redirect tool to set up a 301 redirect. Is there another step I should be taking? I can't figure out why the homepage redirect works but none of the subdomain redirects do.

Thanks for any help!
 
Last edited by a moderator:

jgramp

Registered
Dec 18, 2011
1
0
51
cPanel Access Level
Website Owner
Add the following to your .htaccess file instead of using the redirect feature in cpanel. This works for me:

Options -Indexes +FollowSymLinks

RewriteEngine On

RewriteBase /

RewriteCond %{HTTP_HOST} ^example.com [NC]

RewriteRule ^(.*)$ http://www.example.com$1 [L,R=301]

RedirectMatch 301 ^/blog/(.*)$ http://blog.example.com/$1

See cPanelTristan's post in this thread: http://forums.cpanel.net/f34/redirect-main-domain-but-not-subdomain-221272.html