I can’t get my head around exactly what I want to do using mod_rewrite.
I want to be able to type in a url such as:
http://site.com/project/project-title/people/alex-coady
or
http://site.com/project/project-title/tasks/task-list-title
which will then be processed at handle.php with the variables available such that:
$_GET['project'] would equal 'project-title'
$_GET['people'] would equal 'alex-coady' (first example)
$_GET['tasks'] would equal 'task-list-title' (second example)
To reiterate: All requests will be managed by handle.php, but if any additional variables are tacked onto the URL, first the keyword people, tasks, projects (and any others I manually add) would be checked and the value immediately after them would be added in the form suggested above.
ie. http://site.com/handle.php?project=project-title&people=alex-coady&tasks= (first example)
Thank you.
How I would handle this is to forget about project,people,tasks and pass everything to the handle.php and then process it there, else you could end up having a rewrite rule for each request you add in the future.
So your mod_rewrite would look like:
And your handle/router would look something like this (example)