Skip to content

Instantly share code, notes, and snippets.

@bea-alec
Created July 23, 2020 17:04
Show Gist options
  • Save bea-alec/1c672e6e27d11e5d550b376fe0f25b59 to your computer and use it in GitHub Desktop.
Save bea-alec/1c672e6e27d11e5d550b376fe0f25b59 to your computer and use it in GitHub Desktop.
diff --git a/docroot/.htaccess b/docroot/.htaccess
index 9a73a3d..a48abe4 100644
--- a/docroot/.htaccess
+++ b/docroot/.htaccess
@@ -69,6 +69,12 @@ AddEncoding gzip svgz
<IfModule mod_rewrite.c>
RewriteEngine on
+ # Drop URL parameters for paths do not need them
+ RewriteCond %{THE_REQUEST} !help?|archive?|admin?
+ RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /([^?]*)\?
+ RewriteCond %{QUERY_STRING} !itok=([0-9]+)
+ RewriteRule (.*) /$1? [R=301,L]
+
# Set "protossl" to "s" if we were accessed via https://. This is used later
# if you enable "www." stripping or enforcement, in order to ensure that
# you don't bounce between http and https.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment