1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

htaccess remove parameter in query string

Discussion in 'Site & Server Administration' started by Sam fas, Feb 4, 2016.

  1. #1
    for some reason our CMS had added after every article ?language=en. We had it fixed but now I need to 301 redirect all links to /subcategory/%artical% without the ?language=en.

    I want to redirect:

    /subcategory/%artical%?language=en

    to:

    /subcategory/%artical%

    I tried this RewriteRule:

    RewriteRule ^subcategory/%1?language=en ^/subcategory/%1 [R=301,NC,L]

    but it did not work.
     
    Sam fas, Feb 4, 2016 IP
  2. zacharooni

    zacharooni Well-Known Member

    Messages:
    346
    Likes Received:
    20
    Best Answers:
    4
    Trophy Points:
    120
    #2
    Sam,

    Try adding ? after the last %1

    RewriteRule ^subcategory/%1?language=en ^/subcategory/%1? [R=301,NC,L]
     
    zacharooni, Feb 4, 2016 IP