131 | | '''Suggestion:''' In the second ''RewriteRule'' directive and in the ''LocationMatch'' directive, change {{{[[:alnum:]]}}} to {{{[^/]}}} because while {{{[[:alnum:]]}}} only matches an alpha-numeric character, {{{[^/]}}} matches any character that is not a slash. This change allows for, among other things, hyphens in project/directory names. Another possibility is to replace {{{[[:alnum:]]}}} with {{{[[:alnum:]\-]}}}, which matches only an alphanumeric character or a hyphen (the backslash "escapes" the hyphen, which would otherwise have special meaning). The [http://httpd.apache.org/docs-2.0/mod/mod_rewrite.html Apache 2.0 mod_rewrite documentation] suggests referencing the Perl regular expression manual page (run {{{perldoc perlre}}} on a system where Perl is installed) for details on regular expressions. Note that it may be preferable to use a pattern that matches only characters suitable for directory names (and, thus, project names) that are valid for your particular installation. |
| 131 | '''Suggestion:''' In the second ''RewriteRule'' directive and in the ''LocationMatch'' directive, change {{{[[:alnum:]]}}} to {{{[^/.]}}} because while {{{[[:alnum:]]}}} only matches an alpha-numeric character, {{{[^/.]}}} matches any character that is not a slash or a dot. This change allows for, among other things, hyphens in project/directory names. It doesn't allow dots, because we don't want to match ".." for security reasons. Another possibility is to replace {{{[[:alnum:]]}}} with {{{[[:alnum:]\-]}}}, which matches only an alphanumeric character or a hyphen (the backslash "escapes" the hyphen, which would otherwise have special meaning). The [http://httpd.apache.org/docs-2.0/mod/mod_rewrite.html Apache 2.0 mod_rewrite documentation] suggests referencing the Perl regular expression manual page (run {{{perldoc perlre}}} on a system where Perl is installed) for details on regular expressions. Note that it may be preferable to use a pattern that matches only characters suitable for directory names (and, thus, project names) that are valid for your particular installation. |