I had my own experience of 301 permanently redirecting a domain to another (every page mapped) and Google properly worked everything out and it never had any problem SEO-wise. However, what if I'm redirecting a whole domain to the sub-directory of another domain in the same manner?
http://www.example.com/ 301 to
And everything underneath is correctly mapped such that
example.com/something/somepage.php?a=1 is 301 permanently redirected to
Does anyone have any experience in this situation? Would it all work out good with regards to SEO?