I've tried a bunch of examples here on SO and modifed them, but none are exactly what I need and as a result either fail with 500 server errors (meaning the rewrite rules are wrong) or redirect just the subdomain to the domain and not any of the full URLs of pages.
I need to redirect all URLs under blog.mydomain.com to www.mydomain.com/blog, i.e. redirect blog.mydomain.com/page1 to www.mydomain.com/blog/page1
This
RedirectMatch 301 ^/ http://mydomain.com/blog/
redirects all URLs of blog.mydomain.com to the root of mydomain.com/blog/, not the full URL. Any ideas?