Darius
Darius

Reputation: 1664

Moving using 301 in htaccess using GET variables

What am I doing wrong? I have

http://www.site.com/shop/viewmy/?ASIN=234FhK3
http://www.site.com/shop/viewmy/?ASIN=423ZH3

Trying to convert to

http://www.site.com/shopping/234FhK3/moved
http://www.site.com/shopping/423ZH3/moved

I'm going to change the "moved" part with an internal redirect after I get some info about the product 234FhK3 , a variable that changes.

I have tried

RewriteCond %{QUERY_STRING} ASIN=([^&]+) [NC]
RewriteRule ^[^/]+/(shopping/)/?$ $1.(/moved)? [L,R=301,NC]

I'm not too good with htaccess rewrites.

Upvotes: 0

Views: 55

Answers (1)

vmeln
vmeln

Reputation: 1309

Try this:

RewriteCond %{QUERY_STRING} ASIN=([^&]+) [NC]
RewriteRule ^shop/viewmy/$ /shopping/%1/moved/? [L,R=301,NC]

Upvotes: 1

Related Questions