RewriteCond不会重写我的URL,而是抛出错误500

I am trying to strip out a single level of my new written directory to avoid repetition of entity names in my URL. The specific name of "Well service" is duplicated as I am passing both the page category and pump category to the URL to render the page and perform relevant queries.

My current URL looks like this

http://mysite/Wellservice/Well-Service/PumpID01

Although this is not a major problem from an aesthetic perspective I would like to clean the URL up further by stripping one level of "Well Service" from the URL to create something that looks like this:

http://mysite/Well-Service/PumpID01

I have tried to build a query to handle this but it causes the server to respond with an Error: 500, my query can be seen below:

RewriteCond %{QUERY_STRING} ^?id=([\w-]+)&s=Wellservice&c=(Well-Service)$
RewriteRule ^product.php/?$ /Pumps/%2/%1/? [R=301,L]

Have I done something wrong in my code for the Error 500 to be returned, or is it not possible to do what I am trying to do.

NOTE:

  • Variable "id" = the pumps id to query the database
  • Variable "s" = the category the pump belongs to to refine query result
  • Variable "c" = the page category to generate any page specific styling including active state