Reaching out for help, as my head is spinning! In my site I have the ability to dynamically generate pages and I use URL parameters to indicate the database and record to use to retrieve the information for display, artwork etc.
The page that uses these parameters, is a single page, but has the potential of display thousands of different versions, based on the records used.
The layout presently is: domain.com/details/?ls=00A&ls2=00B
BUT Facebook, does not play ball with sharing such a defined page. Thus I need to convert this into a virtual page that is more of this layout:
domain.com/details/00A-00B/
Where parameter 1 is 00A and parameter 2 is 00B
I believer this has something to do with changing the rewrite rules or creating endpoints, but since the number of extensions off of the page called "details" can be thousands, that seems to defeat the point of dynamically generated pages and self maintenance.
How would someone recommend to achieve a wild-card effect of the extension:
domain.com/details/*
It appears to be simular to this post: Passing & Reading URL Parameters with URL re-writing
Yet that post and other similar ones, are more geared toward a "Fixed" extension and I am looking for a wild card extension that can be read by custom code (via a shortcode) on the Details page.
Other posts, such as this: Facebook sharer and parameters in URL Gave no viable answer.
On the facebook from, I have all the open graph Meta tags modified via Javascript, after the fact and have confirmed the existance. It is just a matter of this virtual page using parameters as a definition.
Need some help.
UPDATE: This is the latest and it is still not working. Requesting help:
add_action( 'init', 'DetailsEndPointRules' );
function DetailsEndPointRules( )
{
add_rewrite_tag("%ls%", '(\d+)'); //database record
add_rewrite_tag("%lid%", '(\d+)'); //List Id
$tag = '^details/(.+)/?$';
$regex = 'index.php?pagename=details&ls=$matches[1]&lid=$matches[2]';
add_rewrite_rule($tag,$regex,'top');
}
// add the url parameters to the query variable list
add_filter( 'query_vars', 'DetailsParametersVariables' );
function DetailsParametersVariables( $vars )
{
$vars[] = 'ls';
$vars[] = 'lid';
return $vars;
}