I want the page mysite.com/product to be accessed with the URL
mysite.com/product/productname instead of mysite.com/product?name=productname
I am trying to achieve this with the code in the plugins main file:
add_rewrite_rule('^(product)/([^/]*)/?', 'product?name=$matches[1]','top');
but I am getting the error:
Fatal error: Call to a member function add_rule() on a non-object in /location/wp-includes/rewrite.php on line 21
Any suggestions?