Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Can anyone spot what I'm doing wrong here? I'm getting an internal server error, and when I see the apache log, I got: ".htaccess: RewriteCond: bad flag delimiters"

So the issue must rely on the .htaccess file...

Can anyone help me out to find what am I missing here?

Thanks a lot.

#already active, still:
Options +FollowSymlinks

#With this definition, our application.ini will be set as development
SetEnv APPLICATION_ENV development

#to allow redirection
RewriteEngine On

#avoid hotlinking
RewriteCond %{HTTP_REFERER} !^$ [OR]
RewriteCond %{HTTP_REFERER} !^https?://(www\.)?site\.dev [NC,OR]
RewriteCond %{HTTP_REFERER} !^https?://(www\.)?site\.something\.com [NC]
RewriteRule \.(jpg|jpeg|png|gif)$ - [NC,F,L]

#if the request is a file or a directory or any other condition, do not redirect  (1st rule), otherwise,  rewrite to index (2nd rule).
RewriteCond %{REQUEST_FILENAME} -s [OR] 
RewriteCond %{REQUEST_FILENAME} -l [OR] 
RewriteCond %{REQUEST_FILENAME} -d 
RewriteRule ^.*$ - [NC,L] 
RewriteRule ^.*$ index.php [NC,L]
share|improve this question

migrated from Apr 24 '11 at 17:05

This question came from our site for professional and enthusiast programmers.

up vote 0 down vote accepted

The .htaccess had no errors.

Can't prove it, but the issue could be related with copy paste issues, since I was copy from an Open Office document, and perhaps, some invisible (to gedit) character has passed, and apache didn't like it.

Anyway, I've used this exact same .htaccess file, but by writing on gedit directly and it worked.


Unix and Linux use LF (Line Feed) and DOS/ Windows use CR/LF (Carriage Return/ Line Feed). You can use such command as 'file' - you can receive: "ASCII text" then the line endings are Unix or "with CRLF line terminators," then Windows

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.