I need to redirect some urls from an old version of a web-site to new urls. I didn't find problem with simple urls, but I can't get the urls with querystrings to work:
Redirect 301 /product_detail.php?id=1 http://www.mysite.com/product/permalink
It simply returns a 404, not found.
I'm also tried with a route on Silex (the PHP micro-framework I'm using) but it didn't work either:
$app->get('/product_detail.php?id={id}', function($id) use ($app) {
$prodotto = Product::getPermalink($id);
return $app->redirect($app['url_generator']->generate('product',array('permalink'=>$prodotto)));
});
Is there a way with some htaccess rule to let the query string be considered as a part of the url and let it be redirected properly?
Thank you.