A port flag halyard???In earlier times the ensign was customarily flown from the gaff peak of the aftermost sail while at sea and from a staff at the stern while moored or anchored. On modern marconi rigs obviously, there is no gaff so yachtsmen either flew the ensign from the backstay or sewn to the leach of the aftermost sail at a position approximating the peak of the gaff on a gaff rig.
Custom has evolved with boat design. Today, most fly the ensign from a stern staff at all times. On my boat the solar panels interfere with the flag on the stern staff so I hoist it to a block seized to the backstay two thirds of the way up.
There are no hard and fast rules but the national ensign should always be flown aft of, not necessarily above, all other flags. If you travel internationally, the cortesy flag of the host country goes at the starboard spreader. If not, you may fly your state flag or yacht club burgee there but never the national ensign. It is also said that you shold not fly two flags on the same hoist but this may not be practical on a modern sloop. (Where would you put the jolly roger and cocktail flags)