New site apache 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://preprod-test.oldsite.com/$1 [P,T,R] RewriteRule ^/uk(.*) http://preprod-test.oldsite.com/ [P,T,R] RewriteLog "/var/log/httpd/www.newsite.com-rewrite.log" Old site apache 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]