Moving a site to sub folder under another site or domain

Suppose you want to move site1.com to under site2.com so after moving site1.com content will look like: site2.com/new. Here are the steps that I took do move it:

  1. Move the content of site2.com to under new folder in site1.com.
  2. Change RewriteBase in site1.com/new/.htaccess
  3. In site2.com/robots.txt change all entries which look like /include/ to /new/include
  4. Setup a .htaccess redirect in site2.com ensuring that even mobile domain(m.site2.com) is properly redirected to m.site1.com/new:
    
    RewriteEngine On
    
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{HTTP_HOST} !^m\.
    RewriteRule ^ http://www.site1.com/new%{REQUEST_URI} [L,R=301,NE]
    
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{HTTP_HOST} ^m\.
    RewriteRule ^ http://m.site1.com/new%{REQUEST_URI} [L,R=301,NE]
    
    
    
  5. Adjust Google Custom Search settings for site1.com
  6. Update site URL's in facebook & Twitter etc