Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

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?

Redirect

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

to

  • https://newpage.silkroad.com/
share|improve this question
    
Have a look at this intro on mod_rewrite. –  ADC Oct 9 '12 at 12:47
add comment

1 Answer 1

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]
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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