I'm looking at the example rewrite rules for nice URLs in
http://www.dokuwiki.org/rewrite and would like to ask for some explanation. I will need to adapt them some because I want to make the URLs omit the first path directory entirely, like
http://wiki.example.com/rewrite instead of
http://example.com/wiki/rewrite.
Three of the option 1 rules have an underscore following the line start anchor.
[m]RewriteRule ^_media/(.*) lib/exe/fetch.php?media=$1 [QSA,L]
RewriteRule ^_detail/(.*) lib/exe/detail.php?media=$1 [QSA,L]
RewriteRule ^_export/([^/]+)/(.*) doku.php?do=export_$1&id=$2 [QSA,L][/m]
The target paths make sense (they do exist in the installed document root). However the patterns don't, because the URL they seem to match would not work in an unmodified setup. Unless Apache has modified the regular expression logic to use underscore to mean something, the URL path would need an underscore here to match. But if it had that without the rewrite being used, it would fail because no directory exists named like this.
The only other thing I can think of is that dokuwiki generates these URL paths with the underscore when it detects that rewrite is being used. But I don't know that such a thing would be easy.
And the next three rules don't involve the underscores. Can someone explain what is going on with these?