]> sipb.mit.edu Git - ikiwiki.git/blob - doc/bugs/po:__apache_config_serves_index_directory_for_index.mdwn
05eec7eee097edbdf01832b7f54230b83e34e1b2
[ikiwiki.git] / doc / bugs / po:__apache_config_serves_index_directory_for_index.mdwn
1 Similarly to [[po:_apache_config_serves_index.rss_for_index]],
2 the [[plugins/po]] apache config has another bug. 
3
4 The use of "DirectoryIndex index", when combined with multiviews, is intended
5 to serve up a localized version of the index.??.html file.
6
7 But, if the site's toplevel index page has a discussion page, that
8 is "/index/discussion/index.html". Or, if the img plugin is used to scale
9 an image on the index page, that will be "/index/foo.jpg". In either case,
10 the "index" directory exists, and so apache happily displays that
11 directory, rather than the site's index page!
12
13 --[[Joey]]
14
15 > Ack, we do have a problem. Seems like ikiwiki's use of `index/` as
16 > the directory for homepage's sub-pages and attachments makes it
17 > conflict deeply with Apache's `MultiViews`: as the [MultiViews
18 > documentation](http://httpd.apache.org/docs/2.2/mod/mod_negotiation.html#multiviews)
19 > says, `index.*` are considered as possible matches only if the
20 > `index/` directory *does not exist*. Neither type maps nor
21 > `mod_mime` config parameters seem to allow overriding this behavior.
22 > Worse even, I guess any page called `index` would have the same
23 > issues, not only the wiki homepage.
24
25 > I can think of two workarounds, both kinda stink:
26 >
27 > 1. Have the homepage's `targetpage` be something else than
28 >    `index.html`.
29 > 2. Have the directory for the homepage's sub-pages and attachments
30 >    be something else than `index`.
31 >
32 > I doubt either of those can be implemented without ugly special
33 > casing. Any other idea? --[[intrigeri]]
34
35 >> As I understand it, this is how you'd do it with type maps:
36 >>
37 >> * turn off MultiViews
38 >> * `AddHandler type-map .var`
39 >> * `DirectoryIndex index.var`
40 >> * make `index.var` a typemap (text file) pointing to `index.en.html`,
41 >>   `index.fr.html`, etc.
42 >>
43 >> I'm not sure how well that fits into IkiWiki's structure, though;
44 >> perhaps the master language could be responsible for generating the
45 >> type-map on behalf of all slave languages, or something?
46 >>
47 >> Another possibility would be to use filenames like `index.html.en`
48 >> and `index.html.fr`, and set `DirectoryIndex index.html`? This could
49 >> get problematic for languages whose ISO codes conventionally mean
50 >> something else as extensions (Polish, `.pl`, is the usual example,
51 >> since many sites interpret `.pl` as "this is a (Perl) CGI").
52 >> --[[smcv]]