Display parent page URL for child page
I have this code that is working but is giving me the wrong link
gives me this link example.com/index.php/sample-page/
but I need this link example.com/sample-page/
?php global $post;
if ( $post-post_parent ) { ?
a href=?php echo get_permalink( $post-post_parent ); ?
?php echo get_the_title( $post-post_parent ); ?
/a Br?php echo get_permalink( $post-post_parent ); ?
?php } ?
Topic permalinks Wordpress
Category Web