title: 500 Internal Server Error error was encountered while trying to use an ErrorDocument to handle the request
body: <p>i have Xfilesharing (perl) script here the official site of it (<a href="https://sibsoft.net/xfilesharing.html" rel="nofollow noreferrer">https://sibsoft.net/xfilesharing.html</a>)<br>
  i installed it on server, and i have javaScript plugin work with php file
  i should put the JavaScript in HTML page then call php file to do something, i try the php file on my localhot and it's work 100%, but along without perl script.</p>
  
  <p>when i upload it to server the following message come to me</p>
  
  <pre><code>The server encountered an internal error or misconfiguration and was unable to complete your request.
  
  Please contact the server administrator, webmaster@*****.com and inform them of the time the error occurred, and anything you might have done that may have caused the error.
  
  More information about this error may be available in the server error log.
  
  Additionally, a 500 Internal Server Error error was encountered while trying to use an ErrorDocument to handle the request.
  </code></pre>
  
  <p>i google it and found some solutions like change permissions and i change it to 0777 but it's not work.</p>
  
  <p>also i changed the name of .htaccess file to .htaccess2 to see what's happened but nothing work.</p>
  
  <p>this .htaccess file</p>
  
  <pre><code>deny from 10.0.0.182
  
  AddDefaultCharset utf-8
  RewriteEngine on
  
  RewriteCond %{HTTP:Authorization} ^(.*)
  RewriteRule ^(.*) - [E=HTTP_CGI_AUTHORIZATION:%1]
  
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteRule    ^([0-9A-Za-z]{12})(\/.+|\.html?|$)   /cgi-bin/index_dl.cgi?op=download1&amp;id=$1&amp;fname=$2 [L]
  
  RewriteRule    ^embed-([0-9A-Za-z]{12})\.html$      /cgi-bin/index_dl.cgi?op=video_embed&amp;file_code=$1 [L]
  RewriteRule    ^embed-([0-9A-Za-z]{12})-(\d+)x(\d+)\.html$      /cgi-bin/index_dl.cgi?op=video_embed&amp;file_code=$1&amp;w=$2&amp;h=$3 [L]
  RewriteRule    ^embedmp3-([0-9A-Za-z]{12})\.html$   /cgi-bin/index_dl.cgi?op=mp3_embed&amp;file_code=$1 [L]
  
  RewriteRule    ^mp3embed-([0-9A-Za-z]{12})\.mp3$    /cgi-bin/index_dl.cgi?op=mp3_embed2&amp;file_code=$1 [L]
  RewriteRule    ^vidembed-([0-9A-Za-z]{12})      /cgi-bin/index_dl.cgi?op=video_embed2&amp;file_code=$1 [L]
  
  RewriteRule    ^box$                    /cgi-bin/index_box.cgi [L]
  RewriteRule    ^dl$                 /cgi-bin/index_dl.cgi [L]
  RewriteRule    ^download$               /cgi-bin/index_dl.cgi?op=download1 [L]
  
  RewriteRule    ^$                   /cgi-bin/index.cgi [L]
  RewriteRule    ^free([0-9]+)\.html$         /cgi-bin/index.cgi?op=registration&amp;aff_id=$1 [L]
  #RewriteRule    ^checkfiles\.html$          /cgi-bin/index.cgi?op=checkfiles [L]
  RewriteRule    ^contact\.html$              /cgi-bin/index.cgi?op=contact [L]
  RewriteRule    ^premium\.html$              /cgi-bin/index.cgi?op=payments [L]
  RewriteRule    ^login\.html$                /cgi-bin/index.cgi?op=login [L]
  RewriteRule    ^catalogue(.*)\.html$            /cgi-bin/index.cgi?op=catalogue&amp;date=$1 [L]
  RewriteRule    ^news([0-9]*)\.html$         /cgi-bin/index.cgi?op=news&amp;page=$1 [L]
  RewriteRule    ^n([0-9]+)-.*\.html$         /cgi-bin/index.cgi?op=news_details&amp;news_id=$1 [L]
  RewriteRule    ^faq\.html$              /cgi-bin/index.cgi?op=page&amp;tmpl=faq [L]
  RewriteRule    ^DMCA\.html$             /cgi-bin/index.cgi?op=page&amp;tmpl=DMCA [L]
  RewriteRule    ^tos\.html$              /cgi-bin/index.cgi?op=page&amp;tmpl=tos [L]
  RewriteRule    ^links\.html$                /cgi-bin/index.cgi?op=links [L]
  RewriteRule    ^make_money\.html$           /cgi-bin/index.cgi?op=make_money [L]
  
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteRule    ^pages/([a-z0-9\-\_]+).html      /cgi-bin/index.cgi?op=page&amp;tmpl=$1$2 [L]
  
  RewriteCond %{QUERY_STRING} .*page=[0-9]+.*
  RewriteRule     ^users/([0-9A-Za-z\-_]{4,64})/?([0-9]+|$)   /cgi-bin/index.cgi [L,NC,QSA]
  
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule     ^users/([0-9A-Za-z\-_]{4,64})/?([0-9]+|$)   /cgi-bin/index.cgi?op=user_public&amp;usr_login=$1&amp;fld_id=$2 [L,NC]
  RewriteRule     ^u/([0-9A-Za-z\-_]+)            /cgi-bin/index_dl.cgi?op=deurl&amp;id=$1 [L,NC]
  RewriteRule     ^d/([0-9A-Za-z\-_]+)                    /cgi-bin/index_dl.cgi?op=deurl&amp;id=$1&amp;mode=2 [L,NC]
  
  RewriteRule    \.pm$                    /404.html [L]
  
  ErrorDocument 404 /404.html
  
  &lt;IfModule mod_php5.c&gt;
          php_flag engine off
  &lt;/IfModule&gt;
  </code></pre>
  
  <p>anyone can help me ?</p>