Removing Trailing Twitter Question Mark from URL

Discussion in 'Apache' started by misohoni, Dec 30, 2014.

  1. #1
    Hi, I want to redirect:
    URL/pop-chart-lab/gothams-villains?utm_medium=twitter&utm_source=twitterfeed
    to:
    URL/pop-chart-lab/gothams-villains

    I saw this code which is similar to what I want to do:
    RewriteCond %{QUERY_STRING} utm_medium=(.*)
    RewriteRule ^(.*)$ /$1? [R=301,L]
    Code (markup):
    But this only rewrites it to the homepage and not the rest of the url before the question mark.

    Any ideas? Thanks
     
    misohoni, Dec 30, 2014 IP