diff --git a/playbooks/roles/gerrit/templates/gerrit.vhost.j2 b/playbooks/roles/gerrit/templates/gerrit.vhost.j2
index d677328fef..817e1f2420 100644
--- a/playbooks/roles/gerrit/templates/gerrit.vhost.j2
+++ b/playbooks/roles/gerrit/templates/gerrit.vhost.j2
@@ -66,9 +66,7 @@
   SetEnv GIT_PROJECT_ROOT /opt/lib/git
   SetEnv GIT_HTTP_EXPORT_ALL
 
-  AliasMatch ^/p/(.*/objects/[0-9a-f]{2}/[0-9a-f]{38})$ /opt/lib/git/$1
-  AliasMatch ^/p/(.*/objects/pack/pack-[0-9a-f]{40}.(pack|idx))$ /opt/lib/git/$1
-  ScriptAlias /p/ /usr/lib/git-core/git-http-backend/
+  RewriteRule "^/p/.*" "-" [F,L]
 
   <Directory /home/gerrit2/review_site/git/>
     Require all granted