I got some strange problem where i have 2 copies of same website in 2 different folders. In one of those 2 copies has whitespace before doctype declaration so i have problem
You don't say which browser you're having problems with. IE used to check the first few letters of the page for a doctype and, if it isn't one (such as whitespace), it would go into quirks mode.