Not sure if you want to redirect only 144=>1556
or it is just an example. Anyway you can try this:
Options +FollowSymlinks -MultiViews
RewriteEngine On
RewriteCond %{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 string
- RewriteRule 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 comparison
- R - redirect (by default with status = 302)
- L - Mark it as last rule
If 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