DONOTCACHEPAGE isn’t working
-
I’m trying to set up a custom field (via ACF) to allow my users to enter a URL to redirect to. This is working fine on the first load, but WP Super Cache is then generating the cached page, even though I have
define("DONOTCACHEPAGE", true)
set. Here’s the full redirect code:<?php $redirect = get_field("redirect"); if ($redirect) { define("DONOTCACHEPAGE", true); wp_redirect($redirect, 301); exit; } ?>
This is at the top of my
header.php
, but I’ve also tried moving it to the top of mypage.php
, with no luck. I don’t see why this wouldn’t work, any help would be greatly appreciated.
- The topic ‘DONOTCACHEPAGE isn’t working’ is closed to new replies.