I have shared this on the SEOPhilippines mailing list and a friend of mine, Noel also from the same group has posted it online on The Search Engine Web Blog and posted it on this page. The Main purpose of this 301 redirect is to forward your website without the “www” to with the “www.” Try visiting http://actiononline.biz and see that it forwards to http://www.actiononline.biz. What difference does it make some may ask, but this is mainly an SEO reason.
Although, every time I use the code, it just gets updated every time. Haha. So here is my latest implementation:
Comparing it with my previous version also on SEOPhilippines.org, the old version will forward a page like http://domain.com/path/page.html to http://www.domain.com/ and not http://www.domain.com/path/page.html. I do suggest into looking into a .htaccess way of doing it with some regex, and probably this method is best if you have some other PHP conditional statements that go with it if you really want to redirect or not, like when you want to the referring URL before you redirect, or the user agent.







0 Comments For This Post
1 Trackbacks For This Post
June 10th, 2007 at 2:06 pm
[...] make it a point I do the right 301 redirects for domain canonicalization issues and I use my own 301 redirect modification using PHP. And that’s basically what I did with my other blogs. Not all my blogs since sometimes I am [...]
Leave a Reply