Sunday, December 27, 2009

Internal Error 500 on Xampp if htaccess exist

Hi,

I was being irritated about the '.htaccess' which is being used widely nowdays to rewrite the URL or in another word; they use it to fake the URL.

In Xampp or any PHP service, the rewrite module is disabled by default. The internal server error 500 will display if you try to execute a directory which has the htaccess and requires rewrite_module. So, you must enable the rewrite module or delete your htaccess file in order to execute any script from that directory.

Deleting the htaccess could be only temporary solution. Enabling the rewrite module would be the real right solution.

I googled for it and found good advise from: http://blogulate.com/content/fix-500-internal-server-error-on-htaccess/ which the blog was written by 'thinkdj'. Credit goes to him.

Here is his original text:
Firstly, make sure LoadModule rewrite_module modules/mod_rewrite.so is enabled in httpd.conf (Remove # before the line to enable)
Then, edit httpd.conf .. Find out the foll lines and mod -
<directory> #replace this with your dir name
Options Indexes FollowSymLinks
Order allow,deny
Allow from all
AllowOverride All #Added
</directory>
<directory>
Options FollowSymLinks
# AllowOverride Limit #Old Value
AllowOverride All #Added
Order deny,allow
Deny from all
Satisfy all
</directory>


After doing the changes I had restart the php service and it works fine now.

Hope that solved your problem too!

Have fun scripting!

No comments: