PLC Programming HandbooksPopular ArticlesNavigationUser login |
Forcing the www in front of the url with mod_rewriteProblem: My website could be accessed with http://www.plcdev.com or http://plcdev.com. While it doesn't seem like much of a problem it caused Google Adsense to go wacky since it doesn't have http://plcdev.com indexed. It also creates problems with search engines not realizing that these two links are the same and therefore diminishing the page rank. Solution: You must have Apache's mod_rewrite enabled on your web host. Create an .htaccess file and add the following
This example works for multiple domains with either a .com or .org ending. For Drupal users this works great in the existing htaccess file in the Various rewrite rules section before any of the other rules. |