[wp-hackers] Possibly OT: Question about rewriting external links

Paul Menard codehooligans at codehooligans.com
Fri Jun 23 02:55:32 GMT 2006


Hey all,

This morning I received an urgent client call. I put together this  
site, about 80 pages, a few weeks ago. On this site, are links that  
take the user to an external eCommerce system to purchase products.  
Seems this external system was down so the client wanted me to go  
through the pages and change the links to point to a local page with  
a message that the eCommerce system was down blah blah blah.

I was able to put together a quick JavaScript function to read all  
the anchors on page load and changed the href. So no big issue. Sure  
I could have build some plugin filter to handle this and convert the  
content. But there are some hard-coded menu links and sidebar  
template text not page of page/post content.

I was wondering is there a good way via Apache or whatever to rewrite  
the URL as the page exits the Web server? Meaning to my knowledge for  
example rewrite rules are performed when the user hits the server,  
inbound. I'm looking to see if there is some filter to convert links  
as part of the outbound delivery to the client browser.

I don't expect to find an answer. Just looking to make sure I'm not  
missing something.

P-


More information about the wp-hackers mailing list