.htaccess "Server error!"

Problems with the Windows version of XAMPP, questions, comments, and anything related.

.htaccess "Server error!"

Postby njckname » 30. June 2008 21:29

I have posted this topic on two other forums and I did not get a reply. I'm trying here.

I'm using XAMPP (basic package) version 1.6.6a

I'm trying to create a script to redirect to r2.php al the visitors that want to download a photo from my server. (this is just for learning purposes)

This is the .htaccess that I've created
RewriteEngine on
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)? [NC]
RewriteRule \.(jpg|jpeg|png|gif)$ /r2.php [NC,R,L]


When I want to visit p.gif ( or any other photo ) I get this error:

Server 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
localhost
06/22/08 19:04:53
Apache/2.2.8 (Win32) DAV/2 mod_ssl/2.2.8 OpenSSL/0.9.8g mod_autoindex_color PHP/5.2.5

Why is that? .htaccess, p.gif, r2.php are al in the same folder.

Does the server error appear because the .htaccess file has syntax errors?
njckname
 
Posts: 1
Joined: 30. June 2008 21:22

Postby Wiedmann » 30. June 2008 21:33

Does the server error appear because the .htaccess file has syntax errors?

The answer you can read in the error.log (or ask the webmaster *g*)

But if I should guess:
You have not enabled mod_rewrite in "httpd.conf"?
Wiedmann
AF Moderator
 
Posts: 17106
Joined: 01. February 2004 12:38
Location: Stuttgart / Germany

Postby Nobbie » 01. July 2008 11:20

Apache/2.2.8 (Win32) DAV/2 mod_ssl/2.2.8 OpenSSL/0.9.8g mod_autoindex_color PHP/5.2.5


Looks like mod_rewrite is not loaded by Apache, therefore the "RewriteEngine" command (and all others) are unknown syntax to Apache.
Nobbie
 
Posts: 8772
Joined: 09. March 2008 13:04


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 41 guests