user1039856
user1039856

Reputation: 1

htaccess to redirect multiple different ID's

I have the below and it works to redirect but there's loads of different ID's for the reviews.php file, is it possible for it to redirect all the id's from 1 to 10000?

RewriteCond %{QUERY_STRING} ^item_id=3105$

RewriteRule ^reviews.php$ /? [R=302,L]

Thanks

Craig

Upvotes: 0

Views: 122

Answers (1)

Mike Almond
Mike Almond

Reputation: 166

This should do the trick. Any reason you're using a 302 instead of a 301?

RewriteCond %{QUERY_STRING} ^(.*)item_id=([0-9]+)$
RewriteRule ^reviews.php$ /?item=%2 [R=302,L]

Upvotes: 1

Related Questions