Skip to content

Instantly share code, notes, and snippets.

View bea-alec's full-sized avatar

Alexander Minor bea-alec

  • U.S. Bureau of Economic Analysis. @us-bea
  • Washington D.C.
View GitHub Profile
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?
@bea-alec
bea-alec / .htaccess_example.txt
Last active July 21, 2020 19:14
mod_rewrite rules
# Drop URL parameters for paths do not need them
RewriteCond %{THE_REQUEST} \?
RewriteCond %{REQUEST_URI} !(^/help|/^admin|^archive) [NC]
RewriteCond %{QUERY_STRING} !itok=([0-9]+)
RewriteRule ^ %{REQUEST_URI} [L,R,QSD]