Fix pretty permalinks in server auto

Implementation of #219 for posts, not just pages.