.htaccess - altering the htaccess file of my WordPress -
i need altering htaccess file of wordpress site me add new variables end of every url.
like want add /es/ end of wordpress urls
please guide way can
i tried custom paramlink below did not worked
/%post_id%/es/
as pointed out in comments, cannot accomplish .htaccess.
it looks want add endpoint posts:
https://codex.wordpress.org/rewrite_api/add_rewrite_endpoint
add_rewrite_endpoint( 'es', ep_permalink | ep_pages ); the above code add es endpoint posts , pages. make sure flush rewrite rules (by visiting permalinks settings page) after adding line, otherwise won't have affect.
you check if endpoint in use this:
global $wp_query; if(isset( $wp_query->query_vars['es'] )) { ... } if end goal localize site, recommend using wpml instead.
Comments
Post a Comment