How does Stack Overflow (and other web sites) remove the 'www' prefix when it's entered as part of a URL?
Is it a redirect, a rewrite or something else entirely?
Update: I'd specifically like to know in the context of IIS 6
How does Stack Overflow (and other web sites) remove the 'www' prefix when it's entered as part of a URL?
Is it a redirect, a rewrite or something else entirely?
Update: I'd specifically like to know in the context of IIS 6
On Apache, it looks like this (inside an .htaccess file):
An easy way to do this is using the Apache "Redirect" directive:
The Redirect directive automatically preserves anything following the
/
in the URL. I find this method easier to read and understand than the Rewrite method.redirect. the sub-domain "www.stackoverflow.com" would simply redirect to "stackoverflow.com".