Forum Moderators: phranque
1) unless a file type is specified, add a trailing backslash to URL
ie: from www.this.com/hello/webmaster/control_panel
to www.this.com/hello/webmaster/control_panel/
2) rewrite URL based on the final directory of the specified URL
ie: from www.this.com/hello/webmaster/control_panel/
to www.this.com/index.php?id=control_panel
OR from www.this.com/something/fruit/green/apples/
to www.this.com/index.php?id=apples
This rule needs to assess what is between the final two forward slashes
We covered that many times here. Did you try a search?
2) rewrite URL based on the final directory of the specified URL
Sounds like a fairly simple regular-expressions and back-reference problem then. A pattern such as
^([^/]+/)*([^/]+)/$
with a back-reference to $2 should solve that relatively efficiently...
For more information, see the documents cited in our forum charter [webmasterworld.com] and the tutorials in the Apache forum section of the WebmasterWorld library [webmasterworld.com].
Jim