Merge pull request #1633 from vlakoff/htaccess

Improve the solution for issue #1631