shengwei
It looks that dokuwiki saves pages, for example for page.txt under namespace, in /data/pages/namespace/page.txt.
If I have attachment files on page.txt, the attachments are saved in /data/media/namespace/. So all attachment files are saved in the directory of namespace. This will become messy when many attachments are saved for different pages.
I want to have dokuwiki create a separate directory under media/namespace for each page and save files under media/namespace/page/attachment. Do I have to hack the codes?