Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
I need to get the path of the current page like - /customer/account/ NOT http://magento.dev/customer/account/index/
Any idea how to do it?
$this->getUrl('*/*/*', ['_current' => true, '_use_rewrite' => true]);
Within a block, you should be able to use...
<?php echo $block->getRequest()->getRequestUri() ?>
...to return just the path portion of the full current page URL.
Required, but never shown