Strange .htaccess behaviour


#1

I have used .htaccess in different domains without problems until now. I open new domain with just one html file and one php file and it works fine until i uploaded a .htaccess!

Just to mention, this file works fine in my local web server (xampp)

Cutting down content of .htaccess dont help. I always recive Internal Server Error and in error.log there is an entry:

[Fri Feb 22 11:52:58 2008] [alert] [client 81.18.63.154]
/home/crollmm/cmcentre.info/.htaccess: Invalid command
’\xef\xbb\xbfRewriteEngine’, perhaps mis-spelled or defined by a module not
included in the server configuration, referer: http://www.cmcentre.info/

content of .htaccess is only:
RewriteEngine On
RewriteBase /

What is wong? I’m affraid to test other domains which works properly. To be sure I tested some subdomains and same other domains and same thing happened.

If someone would like to help I would like to give FTP access to one of acounts.

Sorry for my English!
Alex


#2

Login to your server and cat the .htaccess file. You will see strange characters.

What is happening is that your text editor is adding some hidden characters to your file so when apache tries to execute it it complains about them.

Try using notepad, vim or if you are on mac set textedit’s to use a unix encoding (not sure if that’s the correct option but you get the idea)


#3

THANKS!!!

This strange characters i saw when view in HEX mod. I use Textpad over 5 years and i haven’t problems until now.

Thak you again,
Alex