.htaccess is important for SEO because it allows you to control server configurations, enabling URL redirection and rewriting, which helps in managing duplicate content and ensuring proper URL structure. It also improves site security and performance by controlling access, enabling caching, and compressing files, all of which contribute to a better user experience and higher search engine rankings.