I'm working on a client site in which I need to receive parameters, passed in the URL, and process them to get data on another page. For example, I have a dropdown list of Football Teams on a page. When the user selects a team, they are redirected to a Teams page, e.g. /football/chelsea-fc/
This is a Wordpress site, so that URL results in a 404 error, unless I set up a specific page for that site. Since there could be hundreds of teams, I don't want to do that. Instead, I've set up one page, with its own PHP template called 'Football'. Its slug is /football/ (template-football.php)
I need to send the /chelsea-fc/ portion of the URL to template-football.php as aparameter, so I can process it and get the data related to that team. But Wordpress removes the paramter from the URL.
I'm imagined the solution involved one or more .htaccess rules, but at the moment I'm failing to pass through the parameters. Here's what I've got so far: RewriteRule ^football/^([A-Za-z0-9]+)/$ /template-football.php=$1 [QSA,L]
Can anyone point me in the right direction with this please?
Thanks in advance!