Active religious sites apply dress rules that surprise visitors who treat them as monuments. The rules follow from what the building is for, and they are usually consistent once the logic is visible.
The building is in use, not on display
A working temple, mosque or church is a place where people are praying while visitors walk through, and the code applies to everyone in the room rather than to tourists specifically.
Sites that have been deconsecrated or converted into museums typically drop the requirements, which is why two similar buildings in one city can differ.
Where a site is partly active, the rule often applies only to the prayer area, and the courtyard or outer precinct is unrestricted.
Modesty rules concentrate on shoulders and knees
The most widespread requirement across traditions is covered shoulders and covered knees for all visitors, which rules out vests, short skirts and above-knee shorts.
Many sites lend wraps or scarves at the entrance, sometimes for a deposit, so a refusal at the door is usually solvable rather than final.
A large scarf packed for the purpose covers shoulders, head or waist as needed and removes the dependence on whether a site happens to lend one.
Head covering rules differ by tradition and gender
Some traditions ask women to cover their hair, others ask men to cover theirs, and some ask everyone. The requirement is not uniform and cannot be generalised.
In several traditions the expectation is the opposite of covering: hats are removed on entry, and keeping one on reads as disrespect.
Because the rules invert between traditions, the reliable approach is to observe what people entering ahead are doing rather than to apply a single habit everywhere.
Footwear rules are about ritual purity
Where shoes are removed, the reason is that the floor is a space kept ritually clean and used for prostration, so outdoor footwear is excluded from it.
The boundary is usually marked by a threshold, a rack or a change in flooring, and it applies from that line inward rather than at the outer gate.
Socks are worth wearing in hot climates, where stone courtyards inside the barefoot zone become uncomfortably hot by midday.
Behaviour matters as much as clothing
Photography restrictions frequently apply to specific inner areas, to worshippers, or to flash rather than to the whole site, and signage is usually explicit.
Service times are the point at which visitor access narrows, and many sites simply close to sightseeing while a service runs.
Where doubt exists, asking an attendant is normal and welcomed. Sites that receive visitors regularly expect the question and answer it routinely.