How can I get custom post types to recognize pretty permalink variables?

Building Custom URLs in WordPress discusses how to use Pretty Permalinks to display posts using additional parameters.

Jump to the section on Custom Query Vars. That’s where your situation begins to be addressed directly.

In particular, you may want to use the example using ‘pre_get_posts‘ to retrieve parameters and adjust the WP_Query using a meta_query, so it doesn’t result in a 404 Error as a result of your additional parameters:

add_action( 'pre_get_posts', 'your_function_name', 1 );

NOTE: You may need to modify your customized url to read more like the following, in order to fit the example provided by this tutorial:

https://your-domain.com/automobile/porsche/model/911/name/carrera

In this example, “model” and “name” are keys, while “911” and “carrera” are their respective values. These can then be used for meta_query searching.