It might seem that way (to you) 🙂 but it’s not…
You need to change the post_link/post_type_link with a filter and then use a rewrite rule.
The function on line 30 in the pastebin explains it and line 58 shows a rewrite.
With that you should be able to adapt it to your needs.