|Server errror 500 on XP test server when adding rewrite in .htaccess|
| 7:12 am on Mar 24, 2008 (gmt 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.
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.
| 1:09 pm on Mar 24, 2008 (gmt 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)|
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.