I have the following issue related to URL rewriting. I am sure there must be some good solution to this.
I converted this URL
domainname.com/index.php?page=product&pid=5&proTitle=Samsung Galaxy
After rewrite it looks like this
domainname.com/products/5/Samsung-Galaxy.html
The .htaccess code looks like this.
RewriteRule ^products/(.*)/(.*).html$ index.php?page=product&pid=$1&proTitle=$2 [nc]
Rewrite Works fine. However, if I try to access old URL i.e domainname.com/index.php?page=product&pid=5&proTitle=Samsung Galaxy the page is still accessible and on top of that being crawled by Google and other search engines. I want If someone tries to access this URL, it should direct them to Page Not Found and this should also not be sniffed by any crawlers.
I am sure there must be a smart way of doing this. Awaiting for some valuable suggestions.