Msg#: 3370007 posted 3:04 pm on Jun 18, 2007 (gmt 0)
That code is badly-broken, such that I cannot tell what was intended -- whether these were supposed to be two different rules, or if the first line was supposed to be a RewriteCond. All I can suggest is this for the second line: RewriteRule ^(([^/]+/)*(^./)+)/?$ index.php?x=$1 [L]
This will rewrite any requested URL containing any number of subdirectories (including zero) plus one subdirectory or extensionless filepath-part with or without a trailing slash to the index.php file with variable 'x' set to the entire path but dropping any trailing slash.
The [NC] flag is not needed, since no literal alphabetic characters are specified in the pattern.
Msg#: 3370007 posted 4:32 am on Jun 20, 2007 (gmt 0)
Apache does that append-slash function with existing directories (see Apache mod_dir), but since these are virtual files and/or directories and don't exist as 'real' files or directories, there is no basis for taking action at the server level. Only your index.php file can determine whether the content referred to by the virtual URL exists or does not exists, and as such it is the agent that should append or remove slashes -- If doing so changes the meaning of the URL in any way.
I'm not sure how it would, so I'm hiding behind the generalized/theoretical language here... :)
Simply put, only index.php can decide if the value for the "x" parameter is "good" and assign any meaning to it.