ikiwiki/doc/bugs/po:__apache_config_serves_i...

53 lines
2.3 KiB
Plaintext
Raw Normal View History

2011-04-01 17:49:48 +02:00
Similarly to [[po:_apache_config_serves_index.rss_for_index]],
the [[plugins/po]] apache config has another bug.
The use of "DirectoryIndex index", when combined with multiviews, is intended
to serve up a localized version of the index.??.html file.
But, if the site's toplevel index page has a discussion page, that
is "/index/discussion/index.html". Or, if the img plugin is used to scale
an image on the index page, that will be "/index/foo.jpg". In either case,
the "index" directory exists, and so apache happily displays that
directory, rather than the site's index page!
--[[Joey]]
> Ack, we do have a problem. Seems like ikiwiki's use of `index/` as
> the directory for homepage's sub-pages and attachments makes it
> conflict deeply with Apache's `MultiViews`: as the [MultiViews
> documentation](http://httpd.apache.org/docs/2.2/mod/mod_negotiation.html#multiviews)
> says, `index.*` are considered as possible matches only if the
> `index/` directory *does not exist*. Neither type maps nor
> `mod_mime` config parameters seem to allow overriding this behavior.
> Worse even, I guess any page called `index` would have the same
> issues, not only the wiki homepage.
> I can think of two workarounds, both kinda stink:
>
> 1. Have the homepage's `targetpage` be something else than
> `index.html`.
> 2. Have the directory for the homepage's sub-pages and attachments
> be something else than `index`.
>
> I doubt either of those can be implemented without ugly special
> casing. Any other idea? --[[intrigeri]]
2011-04-04 13:16:09 +02:00
>> As I understand it, this is how you'd do it with type maps:
>>
>> * turn off MultiViews
>> * `AddHandler type-map .var`
>> * `DirectoryIndex index.var`
>> * make `index.var` a typemap (text file) pointing to `index.en.html`,
>> `index.fr.html`, etc.
>>
>> I'm not sure how well that fits into IkiWiki's structure, though;
>> perhaps the master language could be responsible for generating the
>> type-map on behalf of all slave languages, or something?
>>
>> Another possibility would be to use filenames like `index.html.en`
>> and `index.html.fr`, and set `DirectoryIndex index.html`? This could
>> get problematic for languages whose ISO codes conventionally mean
>> something else as extensions (Polish, `.pl`, is the usual example,
>> since many sites interpret `.pl` as "this is a (Perl) CGI").
>> --[[smcv]]