Earlier on my site i haven't used php urlencode function to encode my url query parameters and google crawled those errors. Now after implementing the change, those indexed old urls are giving 404 response code.I tried to redirect old urls to new via htaccess rewrite but it's not working.
Suppose I want to redirect /category/Science.html
to new url /category/Science, Engineering & Technology.html
. For Science, Engineering & Technology
, i am getting 'Science%252C%2BEngineering%2B%2526%2BTechnology' via urlencode
function.
When i tried to rewrite the urls via this rule:
RewriteRule ^category/Science.html$ /category/categ.php=Science%252C%2BEngineering%2B%2526%2BTechnology[R=301,L]
it doesn't work.
Please suggest the proper way to solve this issue.