Want to understand how you'll be able to rewrite www.site.com/?lang=p to www.site.com/p in wordpress while using htaccess rewrite or even the wordpress rewrite. The code could be added in to the wordpress files or in to the .htaccess file

Here's a method to make this happen within WordPress:

function stack7478067_init() Wordpress_Query

    add_rewrite_tag( '%lang%', '([A-Za-z]+)' )

add_action( 'init', 'stack7478067_init' )

function stack7478067_pre_get_posts( $query ) p, redirect

        die( wordpress_redirect( site_url( 'de/' ) ) )


add_filter( 'pre_get_posts', 'stack7478067_pre_get_posts' )