Web News


E-mail spam at all-time high
Spam has reached an all-time high of 77 per cent of e-mail traffic in Canada and the U.S., says an Internet security expert. "It's a remarkable thing," Jordan Kalpin, Canadian regional director for IBM Internet Security Systems, said this week after IBM released a comprehensive security report. "Organizations spend...

Videotron teams up with Cisco
Internet service provider Videotron and Cisco Systems Canada. have teamed up to deliver residential bandwidth speeds of up to 100 Mbps to Videotron’s customers. The Cisco Wideband technology, which is being tested through Videotron’s Internet Protocol Next Generation Network (IP NGN), has been accessible...

Glitch hampers Vista family pack option
Microsoft said Friday that it is working to resolve a glitch that prevented some customers from taking advantage of the company's Vista family pack option. The company is offering Vista Ultimate buyers in the U.S. and Canada the option of purchasing up to two additional licenses...

Vonage Canada and Motorola offer Canadians more...
Vonage Canada, an innovative provider of home phone service that leverages the power of the Internet, and Motorola Canada, today announced the availability of the Motorola VT2142 phone adapter and router. This new Motorola device, configured with the Vonage phone service, helps allow consumers to utilize their....

Vonage York Region launches 'soft-walled' school...
The York Region District School Board has installed a videoconferencing program to help teachers learn how to integrate technology into the classroom in partnership with Microsoft Canada. Microsoft Canada Thursday said it added the York Region District School Board...


02.05.07


Remove The WWW Subdomain

By Mads Kristensen

Many websites have two points of entry for each individual page - one with www and one without. It means that if other websites link to yours, they might link to the same page using two different addresses.

If you make sure that all incoming links point to the same address, you also make sure that various page ranking algorithms of the different search engines give the page full credit for each incoming link.

We can achieve this be simply remove the "www" in the URL's on a website. That also makes the URL shorter and maybe easier recognizable. There are two ways to do this; we can use server-side or client-side techniques. The server-side is the best one, but it cannot be used by all, so I provide a JavaScript version as well.

Client-side
Add this script tag to the header of your web pages. This is the solution I have implemented here on this blog, because I cannot use the server-side approach.



The reason why I can't use the server-side approach is because dasBlog is a .NET 1.1 project and I haven't got Visual Studio 2003 installed on my machine. In with the new, out with the old and face the consequences.

Cost Effective Website and Network Monitoring
IPCheck Server Monitor - Free Download

Server-side
The server-side version uses an HttpModule to filter the incoming requests and redirects them to the URL without "www". I've modified a little upon the excellent HttpModule of Keyvan Nayyeri.



For discussions about the use of 302 vs. 301 redirections, please see the comments on Keyvan's post for details and make your own decision.

Implementation
Download the RemoveWwwModule.cs below and put it the App_Code folder in the root of your website. Then add the following lines to the web.config's section:



Download
RemoveWwwModule.zip (,66 KB)

Comments

About the Author:
Mads Kristensen currently works as a Senior Developer at Traceworks located in Copenhagen, Denmark. Mads graduated from Copenhagen Technical Academy with a multimedia degree in 2003, but has been a professional developer since 2000. His main focus is on ASP.NET but is responsible for Winforms, Windows- and web services in his daily work as well. A true .NET developer with great passion for the simple solution.

http://www.madskristensen.dk/

About DevWebProCanada
DevWebProCanada is for professional developers ... those who build and manage applications and sophisticated websites. DevWebProCanada delivers via news and expert advice New Strategies In Development.

DevWebProCanada is brought to you by:

SecurityConfig.com NetworkingFiles.com
NetworkNewz.com WebProASP.com
DatabaseProNews.com SQLProNews.com
ITcertificationNews.com SysAdminNews.com
LinuxProNews.com WirelessProNews.com
CProgrammingTrends.com ITmanagementNews.com


-- DevWebProCA is an iEntry, Inc. publication --
iEntry, Inc. 2549 Richmond Rd. Lexington KY, 40509
2007 iEntry, Inc.  All Rights Reserved  Privacy Policy  Legal 


archives | advertising info | news headlines | free newsletters | comments/feedback | submit article


Delivering IT Solutions DevWebProCanada News Archives About Us Feedback DevWebProCanada Home Page About Article Archive News Downloads WebProWorld Forums Jayde iEntry Advertise Contact