Hello everybody,
so this sounds pretty easy and basic. Following the advice in
http://httpd.apache.org/docs/1.3/misc/rewriteguide.html this was entered in the root .htaccess file:
Options +FollowSymlinks
RewriteEngine on
RewriteCond %{HTTP_HOST} !^www\.mydomain\.com [NC]
RewriteCond %{HTTP_HOST} !^$
RewriteRule ^/(.*) http:\/\/www\.mydomain\.com/$1 [L,R]
But it doesn't work. Loading a page with or without the "www." prefix by typing in browser address bar works fine, so both variants are supported by the web server (Apache 1.3.41).
Checking the host name with request.getServerName() in a .jsp file served by Resin 3.1.8 shows "mydomain.com" in both variants, i.e. also when the page is loaded with the "www." prefix.
Any hint in the right direction is highly appreciated!
