Please help with this redirect

Hi,

I want to redirect from old link to new link

japan.dina.com/online/handbags/DinaNewsOtherView?langId=-10&storeId=10001&catalogId=12222&contentName=/CompanyInformation/DinaNews/cji_landing

to

japan.dina.com/online/handbags/LandingView?langId=-10&storeId=10001&catalogId=12222&contentName=/CompanyInformation/DinaNews/landing

i have tried many options but couldnt make it.

Please help me.

Thanks in Advance.

How many URLs do you have in this fashion? If it’s only a few you’d probably be better of with simple Redirect (or indeed RedirectMatch). If it’s a whole lot we’d might have to look in to a mod_rewrite solution.

its just one URL…

It looks as though Redirect doesn’t support query strings …
Try this


Option +SymLinks
RewriteEngine On
RewriteCond %{QUERY_STRING} ^langId=-10&storeId=10001&catalogId=12222&contentName=/CompanyInformation/DinaNews/cji_landing$
RewriteRule ^online/handbags/DinaNewsOtherView$ online/handbags/LandingView?langId=-10&storeId=10001&catalogId=12222&contentName=/CompanyInformation/DinaNews/landing

Note that this way the query string has to be exactly langId=-10&storeId=10001&catalogId=12222&contentName=/CompanyInformation/DinaNews/cji_landing. If one of the parameters changes, or the order of the parameter changes, it won’t work anymore.

HTH :slight_smile:

Hey Thanks for the prompt reply…but its still not working

i think there is problem at contentName=/CompanyInformation/DinaNews/cji_landing “/”.

is there any way there any why to resolve this.

i have alo tried

RewriteCond %{QUERY_STRING} ^langId=-10&storeId=10001&catalogId=12222&contentName=(.*)$
RewriteRule ^online/handbags/DinaNewsOtherView$ online/handbags/LandingView?langId=-10&storeId=10001&catalogId=12222&contentName=/CompanyInformation/DinaNews/landing [NC,R=301]

Does it work if you remove the RewriteCond and only have the RewriteRule ?

i have tried that way also but not working…

Are you on Apache 1.x by any chance?
Oh, and +SymLinks should be +FollowSymLinks … :blush:

Try


Option +FollowSymLinks
RewriteEngine On
RewriteRule ^/?online/handbags/DinaNewsOtherView$ online/handbags/LandingView?langId=-10&storeId=10001&catalogId=12222&contentName=/CompanyInformation/DinaNews/landing

If that doesn’t work I think mod_rewrite is not enabled and/or you’re not allowed to use it.

hey there are other rewrite rule as well which are working perfectly…

there is also one rewrite rule with RewriteCond

RewriteCond %{QUERY_STRING} ^langId=-10&storeId=10001&catalogId=12222
Different Rewrite rule…

i believe in the rewrite rule that you have specified there is some problem in taking content after slash (/) contentname=“/”…can you provide any way to resolve this issue…

The slashes in the URL are perfectly fine, so I’m guessing it’s something else. Could you post (or PM) your complete .htaccess with the new lines in place please?