views:

24

answers:

1

I'm using [A-Za-z0-9_-] to match letters, numbers and _ and - in my regular expression. I'd like to add the ' character to it but most of my attempts result in server error 500.

Here's the full line from my htaccess:

RewriteRule ^[A-Za-z0-9_-]+/?$ /index.php
+1  A: 

Have you tried escaping it with \?

burningstar4
A rule like: `RewriteRule ^[a-zA-Z0-9_-\']+/?$ /index.php` should work.
sigint
500 Internal Server Error :/
Bob the Knob
Might be because the - in a character class has special meaning, try putting that in front. `RewriteRule ^[-a-zA-Z0-9_']+/?$ /index.php` Right now you're saying match from the character _ to the character \ which doesn't really make sense.
that worked, thanks fy-tide!
Bob the Knob