Something is F'd up in the new 2.1.3, check out your store view vs site view settings in the stores configuration. I had some major issues with 2.1.3 and rolled back. I think I fixed the one you had in the stores configuration by setting the base URL in the store view as well as the site view. Unlike other versions it wasn't inheriting the base URL from the site view.
I could sit here and bash all day long Magento 2. My mistake for choosing it.
I did what you said and it fixed the redirect. Now only if showed the correct store. Does not show my template or my products for the store. I tried to test all variations of the template in web and site views. No luck.
I guess I will rollback again for a second time. I'm going to sit on the next three updates until they get a project manager to shake things up.
You might need to check your .htaccess file, it gets over-written on the updates, so need to add in that line that redirects to the correct store view.
Try this. https://github.com/magento/magento2/issues/7943#issuecomment-269508822
Jupiter01. I luv ya man! This works for me.
Uggh!! Just when I thought I could update to 2.1.3. My checkout page is blank after clicking on product cart button. All header menu links cannot be clicked. Cursor has no effect on page.

Did you install any third party extensions or make any modifications to the checkout?
I just updated my local environment to 2.1.4 and am still seeing N+1 stores redirected to base store. I even tried setting the base_url at the store level instead of website. For the record, my local is nearly vanila (no custom theme, using sample data only. Add multiple websites to handle different locales and custom settings per locale). All non-core code works perfectly fine on 2.1.2. As soon as I update to 2.1.3 or 2.1.4 this redirect bug starts happening.
We're experiencing the same problems. It seems to be caused by setting the Base Link URL to 'Use system value'. On Magento 2.1.2 this is resolved correctly:

On Magento 2.1.4 it is resolved to the first domain that is visited and then cached:

Causing all stores to redirect to whichever store is accessed first.
Workaround:
specify Base URL and Base Link URL for both Base URLs and Base URLs (Secure) in Stores->Configuration->General->Web for all 'stores' and 'store views' scopes
I just did some retesting on a vanilla 2.1.4 with sample data and I am not seeing this issue any more. Perhaps it _was_ fixed in 2.1.4 after all?
FYI, I am not seeing the issue that @rhertogh reported.
The same issue after updating from Magento 2.1.3 -> Magento 2.1.6
All Store view URL's redirected to default store view.
Solution by @rhertogh : not helped
I'm getting this same issue in 2.1.7 - even settings like @rhertogh didn't help. Is there at least another work-around in the mean-time? What I don't understand is it has to be more than us that it's affecting so how can Magento have an unsolved error like this for so long (if it is a Magento bug)?
The strange part is, if I debug the setBaseUrl in mage/url.js, it returns the correct url until /checkout/ - then it returns it with the default store code instead of the actual store code. In fact, it gets set twice - once by /checkout and then again by authenticationPopup.
Hi folks, I found a work-around: made a copy of magento/module-customer/view/frontend/templates/account/authentication-popup.phtml into my theme.
After the following line: