Jacob
Jacob

Reputation: 183

.Htaccess - Server error

I'm getting the following error

The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there was an error in a CGI script.

If you think this is a server error, please contact the webmaster.

Error 500

184.82.228.38 Mon Jan 9 02:48:12 2012 Apache/2.2.21 (Unix) DAV/2 mod_ssl/2.2.21 OpenSSL/1.0.0c PHP/5.3.8 mod_apreq2-20090110/2.7.1 mod_perl/2.0.5 Perl/v5.10.1

Im running a XAMPP server here is my htaccess file, i don't understand what the problem is.


    AuthType Basic
                AuthName "Members Area"
                AuthUserFile /opt/lampp/htdocs/.htpasswd
                Require valid-user

                <FilesMatch "(async-upload\.php|wp-cron\.php|xmlrpc\.php)$">
                Satisfy Any
                Order allow,deny
                Allow from all
                Deny from none
                </FilesMatch>
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /members/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /members/index.php [L]
</IfModule>

# END WordPress

Upvotes: 12

Views: 65753

Answers (9)

Wellington1993
Wellington1993

Reputation: 369

I solved after just disabling a module:

sudo a2enmod -d deflate

Killing apache and restarting the apache service.

Maybe disabling recent enabled modules solve your problem.

Upvotes: 0

Disabling htaccess solved the problem for me just now. (Thanks community.) However, rather than subtly deleting the ".", I changed the file name to ".htaccess.disabled".

It achieves the same thing, but it's much easier to spot if I forget to re-enable it later. (I think all of us here can think of a time when hours were wasted because of a missing punctuation mark.)

Upvotes: 0

square_eyes
square_eyes

Reputation: 1281

I know this is old but this worked for me. How to use htpasswd to create protected directories XAMPP / apache

Essentially, you need to put the OS dir of the htpasswrd file (which is outside htdocs for security reasons). Apache can read your file system, you just have to tell it where the file is.

Upvotes: 0

Jignesh Rawal
Jignesh Rawal

Reputation: 549

Delete the .htaccess file and let wordpress create a new one for you[This is if you are running a wordpress site]. Things will be up and running.I had the same issue and got it sorted

Upvotes: 0

Zeth
Zeth

Reputation: 2658

I know that this post is old as a mole, but it helped me find my answer still. So I thought, that I would share my solution anyhow.

My problem was, that I had a .htaccess-file in the htdocs-folder. When I moved/renamed it, then it worked.

My .htaccess-file looked like this:

Header add "disablevcache" "true"

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^\.]+)$ $1.php [NC,L]

RewriteCond %{HTTP_HOST} !^www.COMPANYNAME.dk$ [NC]
RewriteRule ^(.*)$ http://www.COMPANYNAME.dk/$1 [R,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule (.*) /404.php [R=301,L]
RewriteCond %{THE_REQUEST} ^.*/index.php
RewriteRule ^(.*)index.php$ http://www.COMPANYNAME.dk/$1 [R=301,L]
ErrorDocument 404 /404.php
ExpiresActive On
ExpiresDefault "access plus 7200 seconds"
Header unset ETag
FileETag None
<ifmodule mod_deflate.c>
SetOutputFilter DEFLATE
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4\.0[678] no-gzip
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip dont-vary
Header append Vary User-Agent env=!dont-vary
</ifmodule>

Upvotes: 0

Kamal Kumar
Kamal Kumar

Reputation: 3763

I got the same error. It was due to incorrect path of .htpassswd file.

To know current directory path you can use following

echo dirname(__FILE__);

Upvotes: 3

Jack Vo
Jack Vo

Reputation: 319

I got the same error before and the problem is the location path of the .htpasswd. Make sure you have set the correct path for that file.

Upvotes: 3

Parthipan
Parthipan

Reputation: 43

Make sure that your script have the shebang line has the correct path. Like,

Xamppinstalleddrive:\xampp\perl\bin\perl.exe

Upvotes: 0

trejder
trejder

Reputation: 17513

Try to copy your .htaccess and other files to some Internet webhosting and see, if the problem exists there. If not, then you'll be sure that this is purely XAMPP problem. I heard many times that it works really purely about .htaccess run locally.

For example, I don't have working autorization using .htaccess locally, because right after I provide correct login and password I see exactly the same error message as you mentioned. As for me, I'm more than sure that this problem is purely related to incorrect interpretation of .htaccess done by XAMPP (as everything works like a charm on production server), not by some mistakes in .htaccess contents.

I wasted (too) many hours on finding solution and left it. For right now, if I'm developing locally, I rename ".htaccess" to "htaccess", so it is ignored by XAMPP (Apache on-board of it) and re-enable it only when deploing files to production server. This approach maybe isn't to professional, but it saved me a lot of time and stress! :]

On the other hand, if your hosting also fail with the same symptoms, then you'll know, that this is not XAMPP releated problem and you have something wrong with your syntax.

Take a look here for a similar problem reported on StackOverflow.com, where (as I think) the cause is the same as in your issue.

Upvotes: 2

Related Questions