htaccess mod_rewrite改变url的结尾

时间:2013-12-04 14:04:43

标签: regex apache .htaccess mod-rewrite

我在产品Feed中犯了一个错误,需要几天才能解决。

我在Feed中的网址是:

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

我需要他们:

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

.htaccess中的重写规则可以修复此问题吗?

1 个答案:

答案 0 :(得分:1)

将此代码放入DOCUMENT_ROOT/.htaccess文件中:

RewriteEngine On

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