I'm trying to to set the function $request to (in the url) what is after / and minus the last 4 characters. SO if it was mysite. com/red-fish.php gives me "red fish"
Thanks Insensus for pointing out a basic concept I was missing. (Well honestly I was just guessing. Amazing how often that works out for me.) With a bit of other tweaking it's doing the job now.