WordPress prevent add_rewrite_rule redirect

189 views Asked by At

On a WordPress website I want content from

http://thesite.com/cars to display the content in http://thesite.com/cars/index

I am trying to do this with the following rewrite rule:

add_rewrite_rule(
  'cars/?$',
  'index.php?page_type=cars&name=index',
  'top');

It works except that it redirects to http://thesite.com/cars/index

Is there any way to prevent the redirect from happening?

0

There are 0 answers