Forum Moderators: phranque
RewriteRule [^\-a-z0-9/_.] - [NC,G]
The hyphen is escaped as shown to avoid confusing the regex parser by making it think you're doing a range comparison. This isn't always necessary, but it is "safe."
[NC] makes the character-comparison case-insensitive.
There is no need to use [L] with [G], because [G] implies [L].
For more information, see the concise regular-expressions tutorial cited in our forum charter [webmasterworld.com].
Jim
The line
RewriteRule [^\-a-z0-9/_.] - [NC,G]
doesn't work on my server - I get an internal server error .
but it works perfectly without the "\" :
RewriteRule [^-a-z0-9/_.] - [NC,G]
So, thank you very much Jim.