When WordPress writes to the .htaccess file when a user first saves their permalink settings, if an .htaccess file already exists and does not end with a blank line, WordPress will corrupt the .htaccess file by appending # BEGIN WORDPRESS onto the end of the last line of the file.
Steps to reproduce:
- Either create a new blog or switch off all permalink settings in your current blog.
- Create (or edit your existing) .htaccess file so that it contains some data. Do not include a blank line (eg. a line break) at the end of the file.
- Now go to your permalink settings page and enable pretty permalinks.
- Open up your .htaccess file again and observe that WordPress has appended # BEGIN WORDPRESS to the end of the last line in the file, thus corrupting whatever data the line contains.
Solution: Whack a "\n" in before # BEGIN WORDPRESS to ensure the last line in the file is left alone.
Patch coming up!