The best way to clean a rug is to vacuum it. Hanging it outside and banging it with a broom or stick will eventually ruin the rug.
Clean spills immediately with a clean, white cloth and a mild dishwashing detergent. Blot the stain, then rinse with water, then blot it dry.
Have rugs professionally cleaned every couple of years.
Do not lay a rug over any carpet. This will wear away the weaves in the carpet beneath the rug.
Turn a rug every six months if it's in direct sunlight to get an even amount of exposure.