As I pointed in my comment, in the rewrite rule there, change ?&p=2
to ?page_id=2
. Because p
is used for querying a Post (i.e. post of the post
type). So for Pages (i.e. post of the page
type), use page_id
.
To prevent http://examplesite.com/fr/
from being redirected to http://examplesite.com/
, you can cancel (the) canonical redirect, like this:
add_action( 'template_redirect', function(){
if ( is_front_page() ) {
remove_action( 'template_redirect', 'redirect_canonical' );
}
}, 0 );