def archive_topic_url(site_url, html_root, sanitized_stream_name, sanitized_topic_name): """ http://127.0.0.1:4000/archive/stream/213222-general/topic/newstreams.html """ base_url = urllib.parse.urljoin(site_url, html_root) return ( f"{base_url}/stream/{sanitized_stream_name}/topic/{sanitized_topic_name}.html" )