Post Reply 
Filter to add hostname to links
Jun. 18, 2006, 01:52 PM
Post: #4
RE: Filter to add hostname to links
You can get the protocol from the URL() command.
So maybe:
Code:
[Patterns]
Name = "Add hostname to links"
Active = TRUE
URL = "[^.]+.(garfield)"
Bounds = "<a\s*>"
Limit = 170
Match = "$URL((http(s|)://)\1*) "
        "\0href=$AV((^http(s|)://)(^\h)(/|) \4)\5"
Replace = "\0href="\1\h/\4"\5"
There are still holes (the Base tag, javascript constructs, etc) tho.
I'd probably worry about them later.

I don't now why relative links would be a problem...
Has your set removed a <BASE*> tag?

HTH
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 - 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: