This is just a redirect. But all links remain the same. Example: if you have <a href="/page2.html">Page2</a> Code (markup): and when you click on "page2" it will still go to www.yoursite.com, and not to yoursite.com. I mean, after you click it will go on second, but link will still remain www in it. (except if you go for <a href="http://yoursite.com/page2.html">Page2</a> Code (markup): ) Hope you understand what I mean
Yes but it is a 301 server side redirect, so it works fine. If you were to click http://www.yoursite.com/page2.html, it would automatically redirect it to http://yoursite.com/page2.html with the code I supplied, or vice-versa. On a side note, I advise against linking to just a page, or image file, by just page2.html, or image.jpg, it is best to use the entire path in the link, such as http://www.yoursite.com/images/image.jpg and not something like ../../images/image.jpg, just because it can help you avoid problems like this, and in the past you needed to do that to avoid your site being 301/302 hijacked, although I don't think that is much of a problem anymore