I want to redirect all requests beginning with www to the same pages without the www.

I've tried the 301 redirect code that cPanel creates, and code from another SitePoint member. Both have the same result: In one directory, most pages are not redirecting. Other directories, and top level pages *are* redirecting, and the redirects show as search engine-friendly.

Here's the current .htaccess file:

RewriteEngine on
RewriteCond %{HTTP_HOST} ^www\.example\.com$
RewriteRule .? http://example.com%{REQUEST_URI} [R=301,L]

ErrorDocument 400 /index.htm
ErrorDocument 401 /index.htm
ErrorDocument 403 /index.htm
ErrorDocument 404 /scripts/404.htm
ErrorDocument 500 /index.htm

My domain is on a hosted, shared Apache server running Linux. If you can think of any other details that might be helpful, please let me know. Thanks!