Forum Moderators: phranque

Message Too Old, No Replies

Error in 301 redirection

Error in 301 redirection

         

learner4ever

9:07 am on Jul 29, 2010 (gmt 0)

10+ Year Member



Hi All, my site is hosted on apache server. I was trying to redirect (301) the non www version of my website to www. The code i was using in my .htaccess file was:

RewriteEngine On

rewritecond %{http_host} ^domain.com

rewriterule ^(.*)$ [domain.com...] [r=301,L]

I have tried the same code earlier on my other websites and it had worked bt now its not working. When I upload htaccess file with above code, i get an 500 Internal Server Error.Can you people suggest any thing.
One more thing that i have found that there are around 5-6 .htaccess file in various folders like vti_log, vti_cnf and others with code:

# -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

Does this code have anything to do with my problem and what the above code mean. Please help.

learner4ever

2:11 pm on Jul 29, 2010 (gmt 0)

10+ Year Member



Ok I figure out the code partially that is authentication code + setting code for view & change the files. But still I have 2 questions:
1. Could anybody tell me why my redirecting code is not working with this code. (when i upload the above redirection code with these lines of code, I got an internal 500 server error)
2. Are these lines of code correct:
<Limit GET POST>
order deny,allow
deny from all
allow from all
</Limit>

Please help.........

jdMorgan

1:06 am on Jul 31, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



When you got the 500-Server Error, what was in your server error log?

It will often tell you exactly what's wrong...

Jim

learner4ever

11:10 am on Aug 2, 2010 (gmt 0)

10+ Year Member



Thanks Jim for replying. But it is working fine now. I tried a modified code for redirection and by luck it worked.

g1smd

12:48 am on Aug 3, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Don't leave things to "luck".

This is your "server configuration code" you are editing.