I need some help redirecting a url with particular parameter value to a new url. For example how can i redirect these two urls with id 123 and 345 to a new url?


  • http://testserver.xyz.com/abc/content/content.jsp?contentId=123
  • http://testserver.xyz.com/abc/content/content.jsp?contentId=345


  • https://newpage.silkroad.com/

Assuming you want a 301 (Moved Permanently) redirect, then put the following in the .htaccess file in your document root:

Options +FollowSymLinks        # Must be enabled if not already
RewriteEngine On
RewriteRule ^abc/content/content\.jsp\?contentId=(123|345)$ https://newpage.silkroad.com/ [R=301,L]

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.