XF 1.5 How to fetch URL of current XenForo page for a meta tag?

OperaManiac

Well-known member
I am trying to add this code to the header in page_container template:

HTML:
<link rel="amphtml" href="https://mercury.postlight.com/amp?url=CURRENTURL">
Google told me that this PHP code would get me the current URL:

PHP:
<?php echo 'https://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']; ?>
If I use this in Page_Container, it does not seem to work. Any solutions? Thanks!
 
Top