In Joomla, there is a fast way of getting the page url by using the Joomla API:

$pageURL = JURI::base(); 
echo $pageURL;

This will get the base url. For example, if the full url is, JURI::base() will fetch

If you need the current absolute path url you must use this:

$uri = & JFactory::getURI(); 
$pageURL = $uri->toString(); 
echo $pageURL;

This website uses cookies so that we can provide you with the best user experience. By clicking "continue" you agree to cookies being used in accordance with our Cookies Policy.