At this time I've got a rewrite rule that appears such as this:

RewriteRule ^product-([a-z^-]+).php /sample.php?m=$1

Basically try likely to "product-test.php", it really works fine.

Basically try likely to "product-test.php?variable=1", it won't work.

How do i customize the rewrite rule to permit the GET variable?

NOTE: The GET variable should only allow letters (Aa-Zz) and dashes (-).

In my opinion it will read

RewriteRule ^product-([A-Za-z\-]+).php /sample.php?m=$1&%{QUERY_STRING}

Note the backslash getting away the dash. The dash is definitely an operator within the matching portion, so it should be steered clear of.

Also, to incorporate GET variables having a rewritten url without spinning them, append the query string identifier towards the finish.

This can rewrite:

www.example.com/product-widget.php?variable=12

to

www.example.com/sample.php?m=widget&variable=12

That is things i believe you're going for.

That getting been stated, I am unsure getting away the dash really works, as I have just discovered an issue utilizing a dash during my rewritten web addresses which i can't appear to solve. It's such as the Apache 1.3.33 rewrite module does not such as the dash within the rewrite string. Anyways, this is the way it will work, also it creates my server.