prepend a string on some URL's but not others
Posted: Sat Feb 25, 2006 9:02 pm
I want to take every link in our website that points to external domain and prepend it with http://www.ourcompany.com/html/home/exit.asp?
so the source would look like:
to:
But I obivousily don't want to prepend it to internal links. Is there a way to do that?
so the source would look like:
Code: Select all
<a href="http://www.someothercompany.com/">Some Link</a>
to:
Code: Select all
<a href="http://www.ourcompany.com/html/home/exit.asp?http://www.someothercompany.com/">Some Link</a>
But I obivousily don't want to prepend it to internal links. Is there a way to do that?