Override l() function in Drupal
- by Marco
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?