0

This is a follow-up question to .htaccess redirect all pages to new domain and How to 301 redirect all pages to the same pages on new domain.

Specifically, how are the following solutions different?

RewriteRule Solution:

RewriteEngine on 
RewriteRule ^(.*)$ http://newdomain.com/$1 [R=301,L]

Redirect Solution:

Redirect 301 / http://newdomain.com/
Community
  • 1
  • 1
Jason McCreary
  • 71,546
  • 23
  • 135
  • 174

1 Answers1

1

It's a server redirect vs. a browser redirect. In the first case internal redirect will be made and a browser will receive a response from the target server.

In the second case a browser will be served with a 301 code (moved permanently) and a Location header with a new URL, at which point it'll need to make a second request to the target server.

You can see the difference yourself, e.g. by installing "Live HTTP Headers" plugin in Firefox and checking all requests that your browser receives.

Oleg Gryb
  • 5,122
  • 1
  • 28
  • 40