diff --git a/awx/ui_next/src/screens/Host/HostDetail/HostDetail.jsx b/awx/ui_next/src/screens/Host/HostDetail/HostDetail.jsx index 92924886b5..316ac4e485 100644 --- a/awx/ui_next/src/screens/Host/HostDetail/HostDetail.jsx +++ b/awx/ui_next/src/screens/Host/HostDetail/HostDetail.jsx @@ -44,7 +44,10 @@ function HostDetail({ host, i18n, onUpdateHost }) { try { await HostsAPI.destroy(id); setIsloading(false); - history.push(`/inventories/inventory/${inventoryId}/hosts`); + const url = pathname.startsWith('/inventories') + ? `/inventories/inventory/${inventoryId}/hosts/` + : `/hosts`; + history.push(url); } catch (err) { setDeletionError(err); }