Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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
add comment

migrated from stackoverflow.com Apr 24 '11 at 17:05

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

1 Answer

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
add comment

Your Answer

 
discard

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.