We used to have a URL http://www.abc.com/index.php?itemID=144which is moved to http://www.abc.com/index.php?itemID=1556we want our users which are hitting the above url(144) to reach to 1556. How can it be achieved. If with mod_rewrite or anything else.
can mod_rewrite be used for this problem?
php;apache;joomla
Not sure if you want to redirect only 144=>1556 or it is just an example. Anyway you can try this:Options +FollowSymlinks -MultiViewsRewriteEngine OnRewriteCond %{QUERY_STRING} (^|&)id=144(&|$) [NC]RewriteRule ^(index\.php)/?$ /$1?id=1556 [NC,R,L]Explanation:RewriteCond is making sure there is id=144 in query stringRewriteRule is making sure that request URI is index.php (optionally followed by a trailing slash). If both conditions are satisfied then rule will redirect to /index.php?id=1556. (Note use of back reference $1 instead of repeating index.php here).Flags used are:NC - ignore case comparisonR - redirect (by default with status = 302)L - Mark it as last ruleIf you really want to replace multiple old IDs to new IDs then I will suggest you to take a look at: http://httpd.apache.org/docs/current/mod/mod_rewrite.html#rewritemap