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?<
On Apache, it looks like this (inside an .htaccess file):
RewriteEngine On RewriteCond %{HTTP_HOST} ^www.example.com$ [NC] RewriteRule ^(.*)$ http://example.com/$1 [R=301,L]