Hi, I am getting an 500 internal server error when using the redirection code in my HTACCESS file.Given is the code i am using:

RewriteEngine On

rewritecond %{http_host} ^domain.com

rewriterule ^(.*)$ http://www.domain.com$1 [r=301,L]

I also have already following lines of code in my htaccess file:

# -FrontPage-

IndexIgnore .htaccess */.?* *~ *# */HEADER* */README* */_vti*

<Limit GET POST>
order deny,allow
deny from all
allow from all
order deny,allow
deny from all
AuthName domain.com
AuthUserFile /home/folder/public_html/_vti_pvt/service.pwd
AuthGroupFile /home/folder/public_html/_vti_pvt/service.grp

Is it because of this code or there is any problem with the redirection code. Please help.......


im a little confused by your question, but to redirect after a 301 error you should include the following

To redirect ALL files on your domain use this in your
.htaccess file if you are on a unix web server:

redirectMatch 301 ^(.*)$ http://www.domain.com
redirectMatch permanent ^(.*)$ http://www.domain.com

You can also use one of these in your .htaccess file:

redirect 301 /index.html http://www.domain.com/index.html
redirect permanent /index.html http://www.domain.com/index.html
redirectpermanent /index.html http://www.domain.com/index.html