htaccess remove the parameter from url

前端 未结 1 1889
你的背包
你的背包 2021-01-06 14:00

I am trying to remove certain url parameters from the urls. Those parameters have no effect on the content being displayed anymore, but google have a bunch of them indexed.

相关标签:
1条回答
  • 2021-01-06 14:35

    You can use this rule to strip all query strings except when param3= is found in it.

    RewriteEngine On
    
    RewriteCond %{QUERY_STRING} .
    RewriteCond %{QUERY_STRING} !(?:^|&)param3= [NC]
    RewriteRule ^ %{REQUEST_URI}? [R=301,L,NE]
    
    0 讨论(0)
提交回复
热议问题