The URL Substitutes is an innovative feature that allows you to change links that Portable Offline Browser downloads on the fly.
It can be accessed in the Project Properties dialog | Advanced section - "URL Substitutes" button.
There are many ways you can benefit from URL Substitutes. An example.
You may be downloading from "www.server.com" that has links to "server.com" and both sites have identical contents. You can convert all links to server.com to point to the first server. This will prevent you from having two copies of the same server on your hard disk.
The URL Substitutes feature is simple to use - you just need to specify which URLs to process and which words to replace with others. You can use keywords in the URL field:
In URL http://server.com/* Replace server.com With www.server.com.
You can use remove certain URL parts, such as Session IDs:
In URL http://*&sid=* Replace &sid=* With (keep the "With" field empty).
The above rule removes all Session IDs from all URLs Portable Offline Browser downloads.
It is also possible to download only print versions of pages. An example for www.washingtonpost.com site:
In URL http://www.washingtonpost.com/wp-dyn/articles/*.html Replace .html With ?language=printer
In URL http://www.washingtonpost.com/wp-dyn/articles/* Replace /wp-dyn/articles/ With /ac2/wp-dyn/
Make sure to check the Apply all matching rules box.
http://www.washingtonpost.com/ac2/wp-dyn/A8403-2004Feb3?language=printer
This way when Portable Offline Browser sees a link to an article, it loads only its "print" copy instead of the normal page.
By default, URL Substitution rules will be applied to all links Portable Offline Browser is about to download. But if you want to load links as they are, but convert filenames that will be saved to your hard disk, uncheck the rule in the rules list.
If you want to relocate parts of a URL to another place, you can use the following syntax:
In URL http://www.srv.com/file.asp? Replace /file.asp?param1=**¶m2=* With /**/*/file.asp
The above will change:
http://www.srv.com/file.asp?param1=abc¶m2=def
to:
http://www.srv.com/abc/def/file.asp
Note: Portable Offline Browser currently supports up to 4 relocated parts - *, **, *** and ****. Please place * as the last part. Parts *** and ** should be used before *.
You can also use URL Macros in URL Substitutes rules. For example: In URL * Replace 11*.gif With {:0day}.gif
However enumerating macros are not yet supported, like {:1..10}, {:server}, {:dir}, {:filename} or {:a,b,c,d}.
The following macros will use Referer URL parts: {:refserver}, {:refdir}, {:reffilename}
For example:
In URL http://www.srv.com/file.asp Replace ?With ?fromserver={:refserver}
Portable Offline Browser applies URL Substitutes to discovered links first and only then checks the modified links against URL and File Filters. If the modified link will not match the filters, it will not be downloaded, but the link in HTML files will be corrected to reflect the modified one.