Apache Internal Server Error – .htaccess: RewriteCond: bad flag delimiters

.htaccess

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]

Best Answer

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