Redirect from subdomain

Try this on your .htaccess file.

RewriteCond %{HTTP_HOST} ^blog\.example\.com  [NC]
RewriteRule ^(.*) http://example.com/$1 [L,R=301]

It simply redirect blog.example.com to example.com or blog.example.com?p=11 to example.com/?p=11.

Source.