Forum Moderators: phranque
Options +FollowSymLinks
RewriteEngine on
RewriteCond %{HTTP_HOST} !^www\.my-domain\.com [NC]
RewriteRule ^(.*)$ [my-domain.com...] [L,R=301]
ErrorDocument 404 /dyn/not_found.htm
Any ideas why?
As such, there is nothing "wrong" with it, and there is no reason it shouldn't work for any requested hostname regardless of hyphenation.
I'd look for problems outside of this code.
This code could be improved (a little) by modifying the RewriteCond to
RewriteCond %{HTTP_HOST} !^www\.my-domain\.com$
Do be sure to completely flush (delete) your browser cache before testing any new server-side code. Otherwise, your browser will show you previously-cached pages and server responses, confusing your test results.
Jim