Mobile app version of vmapp.org
Login or Join
Miguel251

: Mod rewrite - redirecting url with certain parameter to new url I need some help redirecting a url with particular parameter value to a new url. For example how can i redirect these two urls

@Miguel251

Posted in: #Apache2 #ModRewrite

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

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


to

newpage.silkroad.com/

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Miguel251

1 Comments

Sorted by latest first Latest Oldest Best

 

@Jamie184

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)$ newpage.silkroad.com/ [R=301,L]

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme