1

I am looking to create a 301 redirect based purely on a query string see b

OLD URL: olddomain.com/?pc=/product/9999 New URL: newurl.php?var=yup 

My normal way of doing this would be

redirect 301 pc=/product/9999 newurl.php?var=yup 

But this time I am trying to match a URL that that only contains the domain and a query string...

What is the best way of doing this?

Thanks

2 Answers 2

1

I used the following to solve my problems:

RewriteCond %{QUERY_STRING} ^pc=/product/9999 RewriteRule (.*) http://www.newdomain.com/index.php?var=yup [L,R=301] 

Thanks

0

I believe this is what you want.

RewriteCond %{HTTP_HOST} ^olddomain\.com$ [NC]
RewriteRule ^\?pc=/product/9999$ http://newdomain/newurl.php?var=yup [NC,R=301,L]

RegEx could be a little off. I did that off the top of my head.

1
  • Thanks, but as it happend i just solved it myself.. Check my answer Commented Mar 23, 2010 at 17:05

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.