404 error when you use https

Can't make mapped domain work correctly. It shows 404 error when you use https and redirects to the main domain instead of sub folder when you are using HTTP.