cache not purging

so i have a website on my apache2 server and recently i added a script like this one: if (window.location.hostname === 'subdomain.example.com') { window.location.replace('https://newdomain.com'/); } so i changed the domain inside window.location.replace, but it still goes to the old domain. i purged cloudflare cache many times, but it stays the same. even when i remove the script, it keeps redirecting. i enabled development mode, did custom cache purge etc, all, but it keeps redirecting to the old domain. also its not a local cache issue, as i tried with many browsers and ips.
6 Replies
Chaika
Chaika8mo ago
Javascript redirects are pretty suboptimal in quiet a view ways (not all clients support js, messes with embedding links, bad for seo, etc), a simple http redirect (301/302) would be a lot more optimal as for your root issue: hard to say much without the actual link. Sounds like it could be some local issue
jersey
jerseyOP8mo ago
yeah, but trying to avoid some bots that dont use js that is why im using js redirect
Chaika
Chaika8mo ago
Cloudflare won't even cache html by default unless you force it to, if you bypass Cloudflare/connect directly do you get the updated redirect?
jersey
jerseyOP8mo ago
what do you mean with bypass cloudflare? the captcha?
Chaika
Chaika8mo ago
The proxy, as a whole, either making the record dns-only or connecting to your web server locally/bypassing Cloudflare being in the middle
jersey
jerseyOP8mo ago
ahh like that, disbling the proxy feature in dns, imma try that ill let u know how it goes ty gonna check if it makes any difference
Want results from more Discord servers?
Add your server