| @@ -8,6 +8,7 @@ The siteconf is read from ~/.w3m/siteconf by default. | |||||||
|  |  | ||||||
| ===== The syntax ===== | ===== The syntax ===== | ||||||
|  |  | ||||||
|  | # comment | ||||||
| url <url>|/<re-url>/|m@<re-url>@i [exact] | url <url>|/<re-url>/|m@<re-url>@i [exact] | ||||||
| substitute_url "<destination-url>" | substitute_url "<destination-url>" | ||||||
| url_charset <charset> | url_charset <charset> | ||||||
| @@ -17,42 +18,39 @@ user_agent "string" | |||||||
|  |  | ||||||
| The last match wins. | The last match wins. | ||||||
|  |  | ||||||
|  | Lines starting with a '#' are ignored. You can use this to annotate the | ||||||
|  | entries. | ||||||
|  |  | ||||||
| ===== Examples ===== | ===== Examples ===== | ||||||
|  |  | ||||||
|  | # This forwards twitter.com to the alternative site. | ||||||
| url m!^https?://([a-z]+\.)?twitter\.com/! | url m!^https?://([a-z]+\.)?twitter\.com/! | ||||||
| substitute_url "https://nitter.net/" | substitute_url "https://nitter.net/" | ||||||
|  |  | ||||||
| This forwards twitter.com to the alternative site. | # This prevents HTTP referers from being sent when you follow links | ||||||
|  | # at the your.bookmark.net. | ||||||
| url "http://your.bookmark.net/" | url "http://your.bookmark.net/" | ||||||
| no_referer_from on | no_referer_from on | ||||||
|  |  | ||||||
| This prevents HTTP referers from being sent when you follow links | # This forwards the Google's redirector to your local CGI. | ||||||
| at the your.bookmark.net. |  | ||||||
|  |  | ||||||
| url "http://www.google.com/url?" exact | url "http://www.google.com/url?" exact | ||||||
| substitute_url "file:///cgi-bin/your-redirector.cgi?" | substitute_url "file:///cgi-bin/your-redirector.cgi?" | ||||||
|  |  | ||||||
| This forwards the Google's redirector to your local CGI. | # When combinated with "decode_url" option turned on, links to | ||||||
|  | # Wikipedia will be human-readable. | ||||||
| url /^http:\/\/[a-z]*\.wikipedia\.org\// | url /^http:\/\/[a-z]*\.wikipedia\.org\// | ||||||
| url_charset utf-8 | url_charset utf-8 | ||||||
|  |  | ||||||
| When combinated with "decode_url" option turned on, links to | # Tell Google we're actually Lynx. (So they send us a text-browser friendly | ||||||
| Wikipedia will be human-readable. | # results page.) | ||||||
|  |  | ||||||
| url m@^https?://(.*\.)google\.com/@ | url m@^https?://(.*\.)google\.com/@ | ||||||
| user_agent "Lynx/2.8.8dev.3 libwww-FM/2.14 SSL-MM/1.4.1" | user_agent "Lynx/2.8.8dev.3 libwww-FM/2.14 SSL-MM/1.4.1" | ||||||
|  |  | ||||||
| Tell Google we're actually Lynx. (So they send us a text-browser friendly | # Tell Twitter we're actually Googlebot. (So they send us a page without | ||||||
| results page.) | # rejection of a JavaScript disabled browser.) | ||||||
|  |  | ||||||
| url m!^https?://([a-z]+\.)?twitter\.com/! | url m!^https?://([a-z]+\.)?twitter\.com/! | ||||||
| user_agent "Googlebot/2.1" | user_agent "Googlebot/2.1" | ||||||
|  |  | ||||||
| Tell Twitter we're actually Googlebot. (So they send us a page without |  | ||||||
| rejection of a JavaScript disabled browser.) |  | ||||||
|  |  | ||||||
| ===== Regular expressions notes ===== | ===== Regular expressions notes ===== | ||||||
|  |  | ||||||
| Following expressions are all equivalent: | Following expressions are all equivalent: | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user