I'm using a custom page template that is intended to create a dynamic content using the wpdb class and some external tables within the database. I'm trying to keep the url's structure as clean as possible, hence im using the 'post name' option in the permalinks..
I'll just give the whole flow so it won't be confusing.
- An user is trying to reach www.domain.com/dynamic/347
- The template is searching for '347' in the database and creates a special dedicated page
- All the rendering is being executed within the template itself (the one that the /dynamic page is using)
The problem is with the mod_rewrite - Since I'm using the post_name option in wp's permalinks - the wordpress itself is trying to access an actual page called '347' under the parent of 'dynamic', instead of rendering dynamic's template and use 347 as a parameter, by 'exploding' the url and retrieve the last value as the dynamic parameter, like this -
$str = "$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";
$dynamic_para = explode("/", $str, 4); // in this case - 347
//... retrieve dynamic_para from db and stuff with it.
How can I bypass wp's current mod_rewrite specifically for this page? Is it even possible? I am trying to avoid sending GET variables with the url, e.g. www.domain.com/dynamic/?para=347