Skip to content

Instantly share code, notes, and snippets.

@cntlscrut
Created July 28, 2020 15:16
Show Gist options
  • Save cntlscrut/8b0937cb44e1e7f2bac748ab0c5b2fb0 to your computer and use it in GitHub Desktop.
Save cntlscrut/8b0937cb44e1e7f2bac748ab0c5b2fb0 to your computer and use it in GitHub Desktop.
# Drop URL parameters for paths do not need them
RewriteCond %{REQUEST_URI} \.(pdf|xlsx|xls) [OR]
RewriteCond %{THE_REQUEST} data?|2020?
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /([^?]*)\?
RewriteCond %{QUERY_STRING} !itok=([0-9]+)
RewriteRule (.*) /$1? [R=301,L]
@bea-alec
Copy link

Is there a need to identify case sensitive?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment