1

I am creating a plugin in joomla 2.5 for externallinks

I want find external links and and add some text before that.

like these:

http://domain.com/new => redirect.php?url=http://domain.com/new

or:

www.domain.com/new => redirect.php?url=www.domain.com/new

or:

domain.com/new => redirect.php?url=www.domain.com/new

i can do all steps but i cant find external links. please help me

user3932710
  • 125
  • 5

1 Answers1

0

The way i would do it is by using js which you can add to a template and not bother with a plugin. The js script should go through all the "a" DOM elements and check if the href is an external link. If so modify the href value.

Fastest way to detect external URLs

Community
  • 1
  • 1
tomjm
  • 328
  • 2
  • 17