homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Pubcon Platinum Sponsor 2014
Home / Forums Index / Code, Content, and Presentation / Apache Web Server
Forum Library, Charter, Moderators: Ocean10000 & incrediBILL & phranque

Apache Web Server Forum

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

5+ Year Member

Msg#: 3608983 posted 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.

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 :)



5+ Year Member

Msg#: 3608983 posted 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?


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

Msg#: 3608983 posted 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.


Global Options:
 top home search open messages active posts  

Home / Forums Index / Code, Content, and Presentation / Apache Web Server
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved