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
</Limit>
<Limit PUT DELETE>
order deny,allow
deny from all
</Limit>
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.......

hi,

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
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.