March 31, 2011

Redirecting Your Visitors to Your Preferred Domain

A typical website is configured to serve the same content via two addresses: example.com and www.example.com. This redundancy will increase the chances of someone reaching that website directly; but poses a problem for search engines, and you.

Search engines treat a domain and its subdomains as different websites altogether. This means that content available on example.com and www.example.com will be indexed and ranked separately. Thus, a page from your website could be presented multiple times in search results, but not as high as it could possibly get. Moreover, search engines weigh the importance of a page in terms of the number of backlinks to that page. If websites backlink to YourAwesomeArticle.html in multiple ways (specifically by omitting or including the www prefix), this weight will be distributed between these URLs.

March 15, 2011

Zoom-to-Fit All Markers on Google Map v3

Google Maps API version 3, like its predecessor, allows you to automatically center and zoom the map around a set of coordinates. This is useful when you add markers or other overlays to a Google map programmatically; the API can center and zoom the map optimally so that all overlays are visible at once glance.

Compared to the Google Maps API v2 example, API v3 makes the process simpler and more logical via the Map.fitBounds() method.