I’m trying to do a redirect from an old site to a new one:
OLD: blog.example.com
NEW: www.example.com/blog
To achieve the above, I got this .htaccess
:
RewriteCond %{HTTP_HOST} ^blog.example.com$ [OR]
RewriteCond %{HTTP_HOST} ^blog.example.com$
RewriteRule (.*)$ http://www.exmaple.com/blog/$1 [R=301,L]
RedirectMatch 301 ^/bournemouth-datacentre/$ http://www.example.com/blog/
And that works fine. On top of that I need to redirect (example):
OLD: blog.example.com/somecategory/some-title-here/
NEW: www.example.com/blog/some-title-here
Note that I’m loosing the category in between domain and title and replacing it with blog. That’s fine.
Can anyone suggest how I can achieve both the subdomain to domain followed by blog redirect as well as the category redirects?
IMPORTANT: Old site is WP, new is Drupal!
Thanks!
You can use:
Try the following code: