Hi
I've got a situation where the old (simple) rewrites need to be changed (ie more complicated) and I don't know how to deal with this
At the moment the rewrite is done with this
RewriteCond %{REQUEST_URI} ^/(gestion)/$
RewriteRule . - [S=3] #skip the next 2 rules if the RewriteCond match
RewriteRule ^([0-9]+)(/.*)+$ index\.php?t=p&p_id=$1 [NC]
RewriteRule ^$ index.php [L]
it checks if the sub-directory is /gestion/ and, if not, get the page_id from a url like this
http://www.domain.com/568/foo/bar/pagename
and rewrite it as this
http://www.domain.com/index.php?t=p&p_id=568
this works fine as is .... BUT now I need to be able to rewrite the folowing urls
http://www.domain.com/p/568/foo/bar/pagename
http://www.domain.com/c/568/foo/bar/pagename
http://www.domain.com/568/foo/bar/pagename
as
http://www.domain.com/index.php?t=p&p_id=568
http://www.domain.com/index.php?t=c&p_id=568
http://www.domain.com/index.php?t=p&p_id=568
so, basically it checks if there's a "/c/" or a "/p/" (or any other letter between two slashes) and, if there is, it assigns that value to $GET['t'] and the numerical value just after it is assigned to $GET['p_id'] - with a default case where, if it doesn't find either "/c/" or "/p/" (or any other letter between two slashes) it automatically assigns "p" to $_GET['t']
how would I go about doing this ? I've been searching but I've not come up with anything ....
Thanks