Alex McDaid
Alex McDaid

Reputation: 269

htaccess mod_rewrite change the end of url

I have made a mistake in a product feed and it will take a few days to fix.

my urls in the feed are:

http://www.example.com/productutm_source=ebay_merchant/

i need them to be:

http://www.example.com/product?utm_source=ebay_merchant/ (notice the question mark)

can a rewrite rule in .htaccess fix this?

Upvotes: 1

Views: 31

Answers (1)

anubhava
anubhava

Reputation: 784888

Put this code in your DOCUMENT_ROOT/.htaccess file:

RewriteEngine On

RewriteRule ^(.+?)(utm_source=ebay_merchant/)$ /$1?$2 [L,R=301]

Upvotes: 1

Related Questions