aboutsummaryrefslogtreecommitdiffstats
path: root/doc/README.siteconf
blob: f173087a031b53e879179368f41e083fb2265aa4 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
The siteconf: Site-specific preferences 

The siteconf consists of URL patterns and preferences associated to them.
You can improve "decode_url" feature by giving charsets of URLs site by site,
or bypass Google's redirector for performance and your privacy.

The siteconf is read from ~/.w3m/siteconf by default.

===== The syntax =====

url <url>|/<re-url>/|m@<re-url>@i [exact]
substitute_url "<destination-url>"
url_charset <charset>
no_referer_from on|off
no_referer_to on|off

The last match wins.

===== Examples =====

url "http://twitter.com/#!/"
substitute_url "http://mobile.twitter.com/"

This forwards the twitter.com to its mobile site.

url "http://your.bookmark.net/"
no_referer_from on

This prevents HTTP referers from being sent when you follow links
at the your.bookmark.net.

url "http://www.google.com/url?" exact
substitute_url "file:///cgi-bin/your-redirector.cgi?"

This forwards the Google's redirector to your local CGI.

url /^http:\/\/[a-z]*\.wikipedia\.org\//
url_charset utf-8

When combinated with "decode_url" option turned on, links to
Wikipedia will be human-readable.

===== Regular expressions notes =====

Following expressions are all equivalent:

/http:\/\/www\.example\.com\//
m/http:\/\/www\.example\.com\//
m@http://www\.example\.com/@
m!http://www\.example\.com/!

With a trailing 'i' modifier, you can specify a case-insensitive match.
For example, m@^http://www\.example\.com/abc/@i matches to:

http://www.example.com/abc/
http://www.example.com/Abc/
http://www.example.com/ABC/

Hostnames, however, are always converted to lowercases before compared.