the #2 rule you provided works fine (as it should for all) but only if I disable an important aspect of coding I use in vhost.conf.
I have the following code :
AddType application/x-httpd-php .php .html .htm AddType application/x-httpd-php-source .phps <Directory /var/www/vhosts/example.com/httpdocs> Options ExecCGI allow from all </Directory>
Having this code together with the #2 example you provided... in .htaccess seems to cause apache to go nuts, and I just get an apache default message..that says apache is working on this domain.
but removing the above coding from vhost.conf , causes the #2 example to work perfectly fine. (non www going to www)
So...why do I need the above coding anyway ? It's used as an SEO enhancement to parse PHP pages on .html pages. I use a custom php program, which is why I need that.
Even if I bump the /httpdocs directory with the above coding into another directory...the redirect coding works fine as well. So it's something with having both codings working on /httpdocs thats causing confusion for apache rewrite.
any ideas on this aspect ? I know it's a little above grade for regular tech support...but any tips are appreciated.