Many user mirgate their static sites from other platform to WordPress for more functionality. But the main problem they face is the URL structure in WordPress. Many platforms provide sites with .html at the end of the URL. So, if these users think to move their site/s to WordPress, they may face problem like 404 errors and lose their visitors.

In the case, you really don’t need to worry at all.

  1. Login to your Worspress Admin panel.
  2. Go to -> Settings -> Permalinks3. Now choose the post structure you want, remove the trailing slash at the end and add .html, .php or anything like .aspx, .do ect.

With Woocommerce

function hdev_permastruct_html( $post_type, $args ) {
    if ( $post_type === 'product' )
        add_permastruct( $post_type, "{$args->rewrite['slug']}/%$post_type%.html", $args->rewrite );
}
add_action( 'registered_post_type', 'hdev_permastruct_html', 10, 2 );
function hdev_category_permastruct_html( $taxonomy, $object_type, $args ) {
    if ( $taxonomy === 'product_cat' )
        add_permastruct( $taxonomy, "{$args['rewrite']['slug']}/%$taxonomy%.html", $args['rewrite'] );
}
add_action( 'registered_taxonomy', 'hdev_category_permastruct_html', 10, 3 );