Correction of Apache Internal Server Error due to htaccess bad flag delimiters
There are several causes that can lead to an Internal Server Error on the Apache web server. One possible cause is incorrect entries in an htaccess file, for example due to incorrectly defined redirects. In this article, we describe how to limit the problem and fix the cause.
Error notification

Your Apache webserver displays the following error notification, when you call up the page:
Internal Server Error The server encountered an internal error or misconfiguration and was unable to complete your request. Please contact the server administrator, example@example.com and inform them of the time the error occurred, and anything you might have done that may have caused the error. More information about this error may be available in the server error log. Apache Server at www.example.com Port 80
Error Log
You will find the following entry in the error log:
[Sun Oct 24 21:58:22 2010] [alert] [client 10.1.1.1] /home/path/.htaccess: RewriteCond: bad flag delimiters
This indicates an incorrect configuration in the htaccess file.
Solution
- Search the htaccess file for incorrect entries
- Comment areas that may be questionable in tests
- Changes were probably made to the htaccess file recently, which led to the internal server error. Compare the latest version of the htaccess file with the last version of the backup (with the diff command). This should enable you to quickly identify and correct the incorrect entries.
|
Author: Werner Fischer Werner Fischer, working in the Knowledge Transfer team at Thomas-Krenn, completed his studies of Computer and Media Security at FH Hagenberg in Austria. He is a regular speaker at many conferences like LinuxTag, OSMC, OSDC, LinuxCon, and author for various IT magazines. In his spare time he enjoys playing the piano and training for a good result at the annual Linz marathon relay.
|
|
Translator: Alina Ranzinger Alina has been working at Thomas-Krenn.AG since 2024. After her training as multilingual business assistant, she got her job as assistant of the Product Management and is responsible for the translation of texts and for the organisation of the department.
|


