views:

86

answers:

2

Hello, my htaccess rule isn't working with rewrite with dashes in:

RewriteRule ^([A-Za-z]+)$ index.php?do=$1 [QSA]

so, www.domain.com/rules works, however, www.domain.com/about-us doesn't

I've verified that www.domain.com/index.php?do=about-us works so it's definately a rewrite issue.

Thanks.

+1  A: 

Your regular expression doesn't include a check for dashes - try:

RewriteRule ^([A-Za-z\-]+)$ index.php?do=$1 [QSA]
richsage
+1 for escaping!
thephpdeveloper
+3  A: 

Your regex only takes a-z and A-Z, change it to [A-Za-z\-] so it will include the - character

Am