structure of posts and pages

You can configure that in admin panel. Just go »Dashboard > Settings > Permalink« settings.