James
James

Reputation: 193

Redirect only urls with certain parameter to a new domain

I am trying to redirect any page on a site that contains a p=item parameter at any point in the url to a specific url on a different domain.

I've tried to piece it together from various instruction on how to do it via htaccess but to no avail.

Upvotes: 0

Views: 140

Answers (1)

Jon Lin
Jon Lin

Reputation: 143906

Try:

RewriteEngine On
RewriteCond %{QUERY_STRING} (^|&)p=item(&|$)
RewriteRule ^ http://different-domain/url? [L,R]

Upvotes: 1

Related Questions