@whoami,
Yes, the url to my-page/ is already being rewritten, it is a page in the WordPress system, as distinct from a post. I think I've worked out what I need to do.
If I retrieve the URL of the request $_SERVER['REQUEST_URI'] I can determine if URLs are being rewritten. Based on my testing so far:
- If the URL contains a ?page_id= then it is not being written and I can append my parameter onto the end and use the standard $_GET variable to get it. For example
mydomain.com/index.php?page_id=15&my_var=10
- If the URL does not contain ?page_id then it is being rewritten and I can append my parameter onto the end of it in a different way and still get it via the $_GET variable. For example:
mydomain.com/my_page?my_var=10
So far in my test both methods are working.
Many thanks for your help.
-techxplorer