Many CMS uses friendly paths and the RewritePath method to rewrite a friendly path to a more cryptic path that contains a query string. A common problem is that the web form is then posted to the cryptic path rather the user friendly path. A workaround can be found at this post.
The solution is to call RewritePath again in the OnLoad event. In CMS, it is quite typical that all pages are inherited from a custom base class derived from the Page class. We can override the custom base class to call RewritePath again, like:
Context.RewritePath(path,
null, query);
Note that it is important to pass “” to query parameter if there is no query string. It will not behave correctly if we pass null.