I want to get <a href="http://site.ru/node/123">New product</a> from l(), and I call it as l('New product', 'node/123'), but this function generates a URL that is not absolute.

How can I generate an absolute URL with l()?

2 Answers 2


You can make a link absolute with:

l(t('New product'), 'node/123', array('absolute' => TRUE));

See l() and url() for more.


Check out l() and the options in url() for how to construct a link with or without http: but basically you need to set the absolute option to TRUE.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.