Welcome to WebmasterWorld Guest from

Forum Moderators: Ocean10000 & incrediBILL & phranque

Message Too Old, No Replies

Server errror 500 on XP test server when adding rewrite in .htaccess

7:12 am on Mar 24, 2008 (gmt 0)

New User

10+ Year Member

joined:Sept 2, 2006
posts: 27
votes: 0

I have installed XAMPP on my test windows XP-box with Apache/2.2.8, PHP/5.2.5 and MySQL/5.0.51a to upgrade my production sites from PHP/MySQL version 4.

This works well, except that I get a server 500 error if I try to add "RewriteEngine On" to my .htaccess file located in public root. I suspect that this might be due to something incorrect with my hosts and httpd-vhosts.conf files.

Windows/system32/drivers/etc/hosts: localhost mysite.local


ServerName localhost:80
DocumentRoot "C:/xampp/htdocs"

<VirtualHost mysite.local>
ServerName mysite.local
DocumentRoot "C:/xampp/htdocs/mysite.local"

Hope someone can tell me what I do wrong here. The site works o.k. for the static pages when I have no rewrite stuff in the .htaccess file, but due to using search engine friendly urls, I need to add the rewrite functionality.

Thanks :)

1:09 pm on Mar 24, 2008 (gmt 0)

New User

10+ Year Member

joined:Sept 2, 2006
posts: 27
votes: 0

It seems as if mod_rewrite is not turned on by default in XAMPP, so seemingly this is the reason :) BUT, I then removed the hash in front of the line "#LoadModule rewrite_module modules/mod_rewrite.so" in httpd.conf, but forgot to stop Apache first. So despite that this was the only change I made, and I put the hash back again, I can no longer start Apache (runs as a service, but does not start up automatically with XP, nor can I start it via XAMPP's control panel)

So how can I repair Apache? And after this has been done, activate mod_rewrite?

1:46 pm on Mar 24, 2008 (gmt 0)

Senior Member

WebmasterWorld Senior Member jdmorgan is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:Mar 31, 2002
votes: 0

http.conf is only parsed on server restart, so it's quite odd that you're seeing an error that seems to be due to changing that file while Apache was running -- This should be perfectly-permissible to do. In fact, if you think about it, it *has* to be allowed so that httpd.conf can be updated on a live server.

The first stop when encountering *any* error is your server error log file; It will often tell you exactly what's wrong.

In order to use mod_rewrite in httpd.conf, the module must be installed, and "Options FollowSymLinks" or "Options SymLinksIfOwnerMatch" must be set in the appropriate container

For use in .htaccess with "Options FollowSymLinks" and "Options SymLinksIfOwnerMatch" not already set in httpd.conf (or conf.d, etc.), "AllowOverrides Options" must be set, so that "Options FollowSymLinks" or "Options SymLinksIfOwnerMatch" can be set in .htaccess.

I'd recommend shutting down Apache, restoring httpd.conf from a backup, and starting over in this case.