http://bugs.winehq.org/show_bug.cgi?id=29193
--- Comment #6 from Dan Kegel dank@kegel.com 2011-11-28 20:15:52 CST --- So don't use mod_rewrite. You could do it with ScriptAliasMatch ^/bug[1-9][0-9]* /usr/lib/cgi-bin/foo.sh and a cgi-bin script like
#!/bin/sh bad_input() { echo "Status: 404 Not found" echo "" echo "The requested URL could not be found." exit 0 } redirect_to() { echo "Status: 301 Moved" echo "Location: $1" echo "Content-type: text/plain" echo "" echo "Redirecting you to $1 now." exit 0 } case "$REQUEST_URI" in /bug*) bugnum="${REQUEST_URI#/bug}";; *) bad_input ;; esac case "$bugnum" in [1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) redirect_to "http://bugs.winehq.org/show_bug.cgi?id=$bugnum" ;; *) bad_input ;; esac