Example: rewrite dokuwiki userwrite 1

    @forbidden path_regexp forbidden /(data/|conf/|bin/|inc/|install.php)
    rewrite @forbidden /lib/exe/fetch.php?media={re.media.1}&{query}
    
    @media path_regexp media ^/_media/(.*)
    rewrite @media /lib/exe/fetch.php?media={re.media.1}&{query}

    @detail path_regexp detail ^/_detail/(.*)
    rewrite @detail /lib/exe/detail.php?media={re.detail.1}&{query}

    @export path_regexp export ^/_export/([^/]+)/(.*)
    rewrite @export /doku.php?do=export_{re.export.1}&{query}&id={re.export.2}

    @doku {
        not path_regexp lib /lib/.*
        path_regexp doku /(.*)
    }
    rewrite @doku /doku.php?id={re.doku.1}&{query}
1 Like