Thursday, June 30, 2011
Simple way to track your htaccess 301 domain redirects
Since I manage multiple websites on one web host. Most hosts statistics logs and even google analytics won't easily track your domain names that use a 301 redirect to other domain names. Since tracking this forward is very important to analyze the value of the 301 forwarding domain. A way to track inbound redirects is necessary.
The easiest way I found to do this is to create a duplicate home page and call it something like 301redirect.html
Your .htaccess file for the forwarding domain should look something like
Redirect 301 / http://yourdomain.com/301redirect.html
This means that every time you see a hit in google analytics or your log stats to this page your 301 domain redirect was successful.
The only problems with this solution is that you will have to remember to change the 301redirect.html page when you change the websites home page.