Forum Moderators: phranque
[edited by: tedster at 6:08 am (utc) on Jan. 18, 2008]
[edit reason] no member domains, please [/edit]
<Files .htaccess>
order allow,deny
deny from all
</Files>
Options -Indexes
ErrorDocument 404/errors/404.htm
RewriteEngine On
RewriteCond %{HTTP_HOST} !^www\.example\.com
RewriteRule (.*) http://www.example.com/$1 [R=301,L]
[edited by: jdMorgan at 7:11 pm (utc) on Jan. 20, 2008]
[edit reason] example.com [/edit]
I'd recommend using the "Live HTTP Headers" add-on for Firefox/Mozilla browsers to examine the redirection sequence to see if it gives you a hint.
If you use a "control panel" make sure that you have not previously configured a redirect that conflicts with your .htaccess redirect -- For example, if there is any redirect from www.example.com to example.com, then that redirect and your new .htaccess redirect will each countermand the other, and you'll get a loop.
As mentioned, be sure you don't have a script that redirects to non-www.
Also, be aware that your ErrorDocument syntax shown above is invalid. It is missing a required space. The line should read:
ErrorDocument 404 /errors/404.htm
Jim