Post Reply 
Filter to add hostname to links
Jun. 18, 2006, 07:25 AM
Post: #3
RE: Filter to add hostname to links
JJoe,
Thanks for the tip. Silly me! I forgot about that principle.
I found instances where there was no slash at the start of the page info, so had
to make allowance for that. I finally got a working filter. What I am wondering
now is if there would be any problem with a secure page having a link to another
secure page on the same host? Is it possible to omit the protocol and hostname in
a link to a secure page? If not, then the filter should be fine. If so, how would
I adjust the protocol to match? What do you think about this filter? So far, I
need it only on the Garfield site, but that is bound to change.

Code:
[Patterns]
Name = "Add hostname to links"
Active = TRUE
URL = "[^.]+.(garfield)"
Bounds = "<a\s*>"
Limit = 170
Match = "\0href=$AV((^http(s|)://)(^\h)(/|) \4)\5"
Replace = "\0href="http://\h/\4"\5"
Fixing the links on a page did not solve my problem with Shockwave leaving off
the protocol and the hostname in its links, but it did solve the problem of
some linked images not being displayed in the Shockwave window.
Add Thank You Quote this message in a reply
Post Reply 


Messages In This Thread
Filter to add hostname to links - Siamesecat - Jun. 16, 2006, 10:40 AM
RE: Filter to add hostname to links - JJoe - Jun. 16, 2006, 07:00 PM
RE: Filter to add hostname to links - Siamesecat - Jun. 18, 2006 07:25 AM
RE: Filter to add hostname to links - JJoe - Jun. 18, 2006, 01:52 PM
RE: Filter to add hostname to links - JJoe - Jun. 19, 2006, 12:19 PM
RE: Filter to add hostname to links - JJoe - Jun. 20, 2006, 12:21 PM
RE: Filter to add hostname to links - z12 - Jun. 21, 2006, 10:01 AM
RE: Filter to add hostname to links - JJoe - Jun. 21, 2006, 02:05 PM
RE: Filter to add hostname to links - JJoe - Jun. 21, 2006, 03:32 PM

Forum Jump: