how can i use htaccess to catch a friendly url like
/error/access/notallowed
and break it down to
error.php?$1=$2
but the real question is what if i have another url
/something/name/joe/address/123_Maples_Lane/city/somewhere
and do the same thing dynamically if all the odd segments are key value pairs to the even segments.
would I need PHP to do the splits in segments or can htaccess create the query on the fly?
apache can’t create a rewrite with an arbitrary number of parameters since it has to work off of a PCRE expression. You would have to use PHP to do this. However, apache, is still involved:
This will route all nonexistent requests to
index.php/and the request will be the path. Then, you can break down the path onindex.php.