New site apache
<IfModule mod_rewrite.c>
RewriteEngine On
# We don't want to rewrite anything coming back from www.oldsite.com!
RewriteCond %{HTTP_HOST} ^www\.oldsite\.com$ [NC]
RewriteRule .* - [L]
RewriteCond %{REQUEST_URI} (/uk$)
RewriteRule ^/uk/(.*) http://www.oldsite.com/$1 [P,T,R]
RewriteRule ^/uk(.*) http://www.oldsite.com/ [P,T,R]
RewriteLog "/var/log/httpd/www.newsite.com-rewrite.log"
</IfModule>
Old site apache
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteLogLevel 3
# Let's take any pass throughs, sourcing content, and deliver them straight to the webserver
RewriteCond %{REQUEST_URI} (/uk$)
RewriteCond %{HTTP_HOST} (www\.newsite\.com)
RewriteRule ^/(.*) /$1 [P,T,R]
RewriteCond %{REQUEST_URI} /website/.*/ [NC]
RewriteCond %{HTTP_HOST} !(www\.newsite\.com)
RewriteRule ^/website/(.*) http://www.newsite.com/uk/$1 [R=302,L]
# For any request to the root of the webserver, redirect to the main newsite.com/uk website.
RewriteCond %{REQUEST_URI} !/errorpages/.*
RewriteCond %{HTTP_HOST} !(www\.newsite\.com)
RewriteRule ^(.*) http://www.newsite.com/uk/ [L,R=302]
# For all requests to /application, pass onto the marketplace login page directly
RewriteCond %{REQUEST_URI} (/application$|/marketplace/$)
RewriteRule ^/(.*) https://www.oldsite.com/application/ [L,R]
</IfModule>