Me too have a similar issue.
I created 2 store-view with different base url based on directory
example.com/it/
example.com/us/
and relative /it and /us dir in magento root with custom index.php to run correct store.
ita store-view is default, so correctly when i go to example.com it is redirect to example.com/it/.
BUT, all categories link are
http://example.com/us/men.html?SID=hfq3tllub6esvukrg21u1jjoi6
why it use /us/?
why SID if "Use SID on Storefront" is set to NO?