942,959 Members | Top Members by Rank

Ad:
  • PHP Discussion Thread
  • Unsolved
  • Views: 159
  • PHP RSS
Jul 30th, 2010
0

Need help with 301 redirection with HTACCESS file

Expand Post »
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.......
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
learner4ever is offline Offline
1 posts
since Jul 2010
Aug 3rd, 2010
0
Re: Need help with 301 redirection with HTACCESS file
hi,

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

PHP Syntax (Toggle Plain Text)
  1. To redirect ALL files on your domain use this in your
  2. .htaccess file if you are on a unix web server:
  3. redirectMatch 301 ^(.*)$ http://www.domain.com
  4. redirectMatch permanent ^(.*)$ http://www.domain.com
  5.  
  6. You can also use one of these in your .htaccess file:
  7.  
  8. redirect 301 /index.html http://www.domain.com/index.html
  9. redirect permanent /index.html http://www.domain.com/index.html
  10. redirectpermanent /index.html http://www.domain.com/index.html
Reputation Points: 15
Solved Threads: 15
Posting Pro in Training
whiteyoh is offline Offline
474 posts
since Jun 2009

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in PHP Forum Timeline: Database ERROR
Next Thread in PHP Forum Timeline: Small Price Comparison Site - Advice Required





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC