How to get base url and current url in Magento 2 is the next topic Mageplaza guides you today. Let's do it by running the code snippet like the following steps. Check Out How to how to get media url in magento 2 ?