Auto-detect $base_url