First of parsing all route with .htaccess will be a bloody pain, you should just handle requested file and its parameters then you should parse parameters inside your php code (this is called as routing) and you will create your routing for your application.
Please check the .htaccess rule below;
#These are our conditions to run our rewrite rule RewriteCond %{REQUEST_FILENAME} !-f #Request is not a file RewriteCond %{REQUEST_FILENAME} !-d #Request is not a directory RewriteCond %{REQUEST_FILENAME} !-l #Request is not a link #This is our rewrite rule RewriteRule ^([a-zA-Z0-9]*)?/(.*)$ $1.php/$2 [QSA,L] #QSA means QueryStringAppend modify according to your need, L means this is my last rule which same with stop processing rewrite rules
And you should have a php code something like below which process the request for your routing
<?PHP $requestedPath = trim($_SERVER["PHP_SELF"],"/"); $request = explode("/",$requestedPath,2); $requestFileName = $request[0]; //This is your requested file as you know already from .htaccess $requestParams = $request[1]; //You should parse this params according to your routing need ?>
Hope these informations helps you about both routing and generic .htaccess rule.
PS: Your request will be like www.example.com/myaction/first-parameter/second-parameter/third-parameter and for this example $requestParams will be first-parameter/second-parameter/third-parameter