Ironically, isn't the server-side feature usually called "rewites"?
You generally have two "servers" open, one on port 80, another on 443.
Request on port 80 get a http 301 or 302 to https://${server}${request_uri}
Usually both ports are served by the same daemon, but different vhosts/servers or whatever you want to call it
Rewrite would normally map /arbitrary/ to /something-else/ or similar things, generally transparently so the client never notices