redirect's tag archives

Change Domain and Keep All Links with .htaccess

The following RewriteRule lives in the .htaccess file at olddomain.com and tells any request coming in to that domain to swap olddomain.com out and replace it with newdomain.com. This includes ANYTHING after the trailing slash, like a direct link to a previous post. So http://olddomain.com/this/direct/link gets sent properly to http://newdomain.com/this/direct/link The important part is the [R=301] which sends a 301 (Permanent) Redirect header. That tells search engines that the page ha...

Using CURL follow redirects to get final url

This example code shows you how to use curl to follow redirects and get final url.