Skip to content

http to https redirect via .htaccess contains /pub in URL?

I am trying to redirect http to https in my Magento 2 store. I added these 2 lines to my htaccess, right after RewriteEngine on.

The redirects works, getting a 301 redirect, just as wanted. Problem is, the redirect looks like that:

http://www.domain.com
301 Moved Permanently

https://www.domain.com/pub/
200 OK

As you can see, there is a /pub after redirecting, it happens for all URLs. Is this a server issue or a Magento issue?