I have a rule: RewriteRule ^/?([^/]*)\/dir\/([^/]*)$ dir.php?a=$1&b=$2%{QUERY_STRING} [L] This works when somebody goes to: http://www.mysite.com/yada/dir/abc HOWEVER it does not work when somebody goes to: http://www.mysite.com/yada/dir/abc/ (note the / after 'abc') How does one make a rule accept (but NOT require) a trailing slash. Thanks.
Add /? just before the $, which stands for an optional forward slash. You line then becomes: RewriteRule ^/?([^/]*)\/dir\/([^/]*)/?$ dir.php?a=$1&b=$2%{QUERY_STRING} [L] This will therefore work for URLs with and without the trailing slash. Cheers, Cryo.