RewriteRule for showing new custom post type layout in old url (1 post)

  1. Comparativa de Bancos
    Posted 4 years ago #


    I want to display in an old url a new template I use for a new custom post type but I dont manage to set up correctly .htaccess.

    Before I had: mysite.com/product-page-b
    now I have created a CPT so I have mysite.com/products/product-page-b

    I managed to rank very well in google serps for mysite.com/product-page-b so I dont want to even 301 to the new url but would like to use the template I have for my "products" cpt (products-single.php) since it has a better layout for that given product and want to replace the old one that is using single.php.

    .htaccess RewriteRule is supposed to do it but I don find the way. For 301 is easy
    RewriteRule ^products/product-page-b/(.*)$ /product-page-b/$1 [R,L]

    but this is not the point in my case.

    I have tried to use the rewrite before and after the "#begin ... end wordpress#" code.

    Any suggestion here? I have searched a lot in internet but found nothing about this precise case.


Topic Closed

This topic has been closed to new replies.

About this Topic

  • RSS feed for this topic
  • Started 4 years ago by Comparativa de Bancos
  • This topic is not resolved
  • WordPress version: 3.3