Override l() function in Drupal
Posted
by
Marco
on Stack Overflow
See other posts from Stack Overflow
or by Marco
Published on 2011-01-10T07:55:09Z
Indexed on
2011/01/10
8:53 UTC
Read the original article
Hit count: 217
I'm currently working on a Drupal site (6.*), which when in production mode will be accessed through some kind of http proxy, which means I will have to rewrite all the links for my custom theme if the $_SERVER['HTTP_X_FORWARDED_SERVER']
variable is set to the domain people will access the site from.
The site has a lot of internal linking, mostly through Views
. My thought is that the easiest way to solve this would be to hook into the url()
and/or the l()
functions and post process the url before returning it if HTTP_X_FORWARDED_SERVER
is set.
My problem is that I can't figure out how to hook into these functions, or if it's even possible without touching the core, has anyone had to do this? How did you solve it?
© Stack Overflow or respective owner