Removing GET parameter in .htaccess

前端 未结 1 1653
迷失自我
迷失自我 2020-12-12 00:53

I\'m not able to remove one GET parameter wrongly added by one 404 SEF module.

I want to remove \"task=view\" only if it appears alone and not with another parameter

相关标签:
1条回答
  • 2020-12-12 01:23

    Use this rule:

    RewriteCond %{QUERY_STRING}  ^task=view$ [NC]
    RewriteRule ^(.*)$ $1? [R=301,L]
    

    ? at the end of $1 will strip-off any existing query string.

    0 讨论(0)
提交回复
热议问题