Fixes a pretty serious .htaccess generation bug

In some cases, the incorrect home URL would be passed to the script
generating the .htaccess rules(adding language info to the URL), thus
creating bad rewrite rules.
Also in case of changing the default language, the category_base and
tag_base options were incorrectly getting multiple language
information(like "en/tr/cateogry) - that's been also fixed now.