Breaking .htaccess

Edited to emphasize my bone-headedness.

I try to be a good web citizen, and set BBEdit to create UTF-8 encoded files by default.

Last night I created an .htaccess file in BBEdit. Something I’d normally do in emacs.

I saved the file, tried loading a page, and got a server configuration error. The error log read /path/to/.htaccess: Invalid command '\xef\xbb\xbfRewriteEngine', perhaps mis-spelled or defined by a module not included in the server configuration.

I had forgotten that the file now has a byte-order-mark because I was using my default encoding. Apache barfs on it.

I fixed it by opening it in emacs and removing the byte order mark. I could had, as one reader suggested, just saved it with the right encoding.

Possibly Related posts (machine generated):

  1. On Blogging One’s Mistakes
  2. More on .htaccess, mod_rewrite, and image stealing
  3. Preventing Image Bandwidth Theft With .htaccess
  4. Digital Colophon
  5. Apache module for publishing server directory contents as an RSS file

More like this: , .

blog comments powered by Disqus