Q:

.htaccess RewriteRule for SEO URL allow "-" symbol

My code is:
Options -Multiviews

RewriteEngine On
RewriteBase /

RewriteRule ^([a-z0-9]+)\.html$ /index.php?cat=$1 [L]

I am new to htaccess and I can't find how to allow "-" symbol to url
For example, if i am accessing mysite.com/categoryname.html it works but if I am accessing mysite.com/category-name.html it doesn't work.

A:

Simply add to your character sets the "-" symbol.
([a-z0-9]+) will be ([a-z0-9-]+)

