I am about to switch my blog onto a subdomain blog.example.com
so I can have two different WordPress themes installed. Currently, my blog resides at example.com/blog
and I was wondering if there were any special 301 redirects or issues that may arise? Would the below 301 redirect format work?
RewriteCond %{HTTP_HOST} ^www\.example\.com$
RewriteRule ^blog/$ http://blog.example.com/? [L,R=301]
or should it be
Redirect 301 /blog http://blog.example.com/
Redirect
arguments. Your two solutions are subtly different. The first only redirects the exact URI path/blog/
when in the directory context. The second redirects any URI path starting/blog
, so/blog/some/thing/else
would be redirected to blog.example.com/some/thing/else.htaccess
file? @StephenOstermiller Since this is WordPress, only the first (mod_rewrite) type of redirect should be used in order to avoid any potential conflict.