redirect 404, domain.com to www.domain.com index.xxx to www.domain.com

I need help .htaccess file which would proform the following:

redirect all error pages including 404 to www.domain.com
permanent redirect domain.com -> www.domain.com
permanent redirect domain.com/index.xxx -> www.domain.com

Also if there is a way to fix this errorIm getting this error Error: 406 Not Acceptable
ido90Asked:
Who is Participating?
 
COBOLdinosaurCommented:
I think what you are askking there is answered with:
Options +FollowSymLinks 
RewriteEngine on
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]

Open in new window



Cd&
0
 
COBOLdinosaurCommented:
If your users are getting a 406 error it is because the server is trying to send something that the browser has indicated it will not accept.  Generally it would be an unacceptable MIME type or an encoding issue.  

as for the redirect, why not just make make www.domain.com/index.html the 404 page:

in the .htaccess

ErrorDocument 404 http://www.domain.com/index.html
ErrorDocument 403 http://www.domain.com/index.html
ErrorDocument 406 http://www.domain.com/index.html



Cd&
0
 
ido90Author Commented:
How do you redirect the .domain to www.domain and also deal with the index.xxx to /?
0
 
James MurrellProduct SpecialistCommented:
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.