Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sooryakiransv/fdad43306bc94a6f0ba04e7c52a9fe56 to your computer and use it in GitHub Desktop.
Save sooryakiransv/fdad43306bc94a6f0ba04e7c52a9fe56 to your computer and use it in GitHub Desktop.
# Disable Woocommerce cart fragments for homepage via .htaccess
# By creating empty response
# Please replace yoursite.com
# Disable only on homepage
RewriteEngine On
RewriteCond %{HTTP_REFERER} ^https://yoursite.com/$ [NC]
RewriteCond %{QUERY_STRING} ^wc-ajax=get_refreshed_fragments$
RewriteRule ^(.*)$ $1 [R=204,L]
# Disable everywhere
RewriteEngine On
RewriteCond %{QUERY_STRING} ^wc-ajax=get_refreshed_fragments$
RewriteRule ^(.*)$ $1 [R=204,L]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment