Added machine-parsable links database, per-page links and page source.
[cocanwiki.git] / conf / cocanwiki.conf
1 # Apache configuration for COCANWIKI.
2 # $Id: cocanwiki.conf,v 1.17 2004/10/27 21:14:05 rich Exp $
3
4 # Uncomment the following lines if necessary.  You will probably need
5 # to adjust the paths to reflect where cocanwiki is really installed.
6
7 # DocumentRoot /usr/share/cocanwiki/html
8 # CamlLoad /usr/share/cocanwiki/html/_bin/cocanwiki.cma
9
10 <Location /_bin>
11   SetHandler ocaml-bytecode
12   CamlHandler Registry.handler
13   Options ExecCGI
14   Allow from all
15 </Location>
16
17 <Location /_bin/admin>
18   # The admin subdirectory contains sensitive scripts, and should
19   # be protected by ACLs and/or passwords.  This is just an example:
20   Deny from all
21   Allow from 10.0.0.249
22 </Location>
23
24 <Location /_graphics>
25   ExpiresActive On
26   ExpiresDefault "now plus 24 hours"
27 </Location>
28
29 <Location /_js>
30   ExpiresActive On
31   ExpiresDefault "now plus 24 hours"
32 </Location>
33
34 <Location /_css>
35   ExpiresActive On
36   ExpiresDefault "now plus 24 hours"
37 </Location>
38
39 <Location /_static>
40   ExpiresActive On
41   ExpiresDefault "now plus 24 hours"
42 </Location>
43
44 # Error documents.
45 ErrorDocument 500 /_bin/crash.cmo
46
47 # Start of the rewrite rules.
48
49 RewriteEngine on
50
51 # The robots.txt file needs special treatment.
52 RewriteRule ^/robots.txt /robots.txt [PT,L]
53
54 # Global scripts.
55 RewriteRule ^/_admin$ /_bin/admin/admin.cmo [PT,L,QSA]
56 RewriteRule ^/_contact$ /_bin/contact.cmo [PT,L,QSA]
57 RewriteRule ^/_email_change$ /_bin/email_change.cmo [PT,L,QSA]
58 RewriteRule ^/_files$ /_bin/files.cmo [PT,L,QSA]
59 RewriteRule ^/_global.css$ /_bin/hoststyle.cmo [PT,L,QSA]
60 RewriteRule ^/_images$ /_bin/images.cmo [PT,L,QSA]
61 RewriteRule ^/_invite$ /_bin/invite_user_confirm_form.cmo [PT,L,QSA]
62 RewriteRule ^/_links$ /_bin/links.cmo [PT,L,QSA]
63 RewriteRule ^/_login$ /_bin/login_form.cmo [PT,L,QSA]
64 RewriteRule ^/_logout$ /_bin/logout.cmo [PT,L,QSA]
65 RewriteRule ^/_mailing_list.csv$ /_bin/mailing_list_view.cmo?csv=1 [PT,L]
66 RewriteRule ^/_ml_confirm$ /_bin/mailing_list_confirm.cmo [PT,L,QSA]
67 RewriteRule ^/_ml_unsub$ /_bin/mailing_list_unsubscribe.cmo [PT,L,QSA]
68 RewriteRule ^/_pe_confirm$ /_bin/page_email_confirm.cmo [PT,L,QSA]
69 RewriteRule ^/_pe_unsub$ /_bin/page_email_unsubscribe.cmo [PT,L,QSA]
70 RewriteRule ^/_recent$ /_bin/recent.cmo [PT,L,QSA]
71 RewriteRule ^/_sitemap$ /_bin/sitemap.cmo [PT,L,QSA]
72 RewriteRule ^/_userprefs$ /_bin/user_prefs_form.cmo [PT,L,QSA]
73 RewriteRule ^/_users$ /_bin/users.cmo [PT,L,QSA]
74
75 # Image and file downloads.
76 RewriteRule ^/_file/(.*)$ /_bin/file.cmo?name=$1 [PT,L,QSA]
77 RewriteRule ^/_image/(.*)$ /_bin/image.cmo?image=$1 [PT,L,QSA]
78
79 # Old _dist subdirectory no longer exists.
80 RewriteRule ^/_dist/ / [R]
81
82 # Page-related scripts.
83 RewriteRule ^/([^_].*)/diff$ /_bin/diff.cmo?page=$1 [PT,L,QSA]
84 RewriteRule ^/([^_].*)/edit$ /_bin/edit.cmo?page=$1 [PT,L,QSA]
85 RewriteRule ^/([^_].*)/editcss$ /_bin/edit_page_css_form.cmo?page=$1 [PT,L,QSA]
86 RewriteRule ^/([^_].*)/edittitle$ /_bin/edit_page_title_form.cmo?page=$1 [PT,L,QSA]
87 RewriteRule ^/([^_].*)/history$ /_bin/history.cmo?page=$1 [PT,L,QSA]
88 RewriteRule ^/([^_].*)/index.rss$ /_bin/rss.cmo?page=$1 [PT,L,QSA]
89 RewriteRule ^/([^_].*)/links$ /_bin/links.cmo?page=$1 [PT,L,QSA]
90 RewriteRule ^/([^_].*)/source$ /_bin/source.cmo?page=$1 [PT,L,QSA]
91 RewriteRule ^/([^_].*)/stats$ /_bin/stats.cmo?page=$1 [PT,L,QSA]
92 RewriteRule ^/([^_].*)/styles.css$ /_bin/pagestyle.cmo?page=$1 [PT,L,QSA]
93
94 # Serve pages.
95 RewriteRule ^/$ /_bin/page.cmo?page=index [PT,L,QSA]
96 #non-greedy matches don't parse - why?
97 #RewriteRule ^/([^_].*?)/?$ /_bin/page.cmo?page=$1 [PT,L,QSA]
98 RewriteRule ^/([^_].*[^/])/?$ /_bin/page.cmo?page=$1 [PT,L,QSA]