johngodley / redirection

Manage all your WordPress 301 redirects and monitor 404 errors
https://redirection.me
GNU General Public License v3.0
549 stars 140 forks source link

A Redirect Is "Stuck" In Browsers after Deletion #3030

Closed Mike-Reid-Marketing closed 2 years ago

Mike-Reid-Marketing commented 2 years ago

Summary: I'm trying to change a redirect on one of my urls, pointing it to a new location. Any help would be much appreciated!

Actual Behavior: I deleted the old redirect and added a new one in the same group. However, browsers are still redirecting to the old destination url. I have tested with curl, which shows the redirect going to the correct place! I have tested Chrome (incognito) on mobile as well as desktop, Firefox, and Brave. I have cleared the cache via WP Rocket.

Environment: Redirection 5.1.3 WordPress 5.8

Mike-Reid-Marketing commented 2 years ago

PS: In case it's helpful, here are the logs for a regular curl, and a curl impersonating a browser:

Data for curl -vv https://REDACTED/page/

Thu, 26 Aug 2021 14:18:14 GMT : Rendered page

➜  ~ curl -vv https://REDACTED/page/
*   Trying X.X.X.X...
* TCP_NODELAY set
* Connected to REDACTED (X.X.X.X) port 443 (#0)
* ALPN, offering h2
* ALPN, offering http/1.1
* Cipher selection: ALL:!EXPORT:!EXPORT40:!EXPORT56:!aNULL:!LOW:!RC4:@STRENGTH
* successfully set certificate verify locations:
*   CAfile: /etc/ssl/cert.pem
  CApath: none
* TLSv1.2 (OUT), TLS handshake, Client hello (1):
* TLSv1.2 (IN), TLS handshake, Server hello (2):
* TLSv1.2 (IN), TLS handshake, Certificate (11):
* TLSv1.2 (IN), TLS handshake, Server key exchange (12):
* TLSv1.2 (IN), TLS handshake, Server finished (14):
* TLSv1.2 (OUT), TLS handshake, Client key exchange (16):
* TLSv1.2 (OUT), TLS change cipher, Client hello (1):
* TLSv1.2 (OUT), TLS handshake, Finished (20):
* TLSv1.2 (IN), TLS change cipher, Client hello (1):
* TLSv1.2 (IN), TLS handshake, Finished (20):
* SSL connection using TLSv1.2 / ECDHE-RSA-AES256-GCM-SHA384
* ALPN, server accepted to use h2
* Server certificate:
*  subject: OU=Domain Control Validated; CN=*.REDACTED
*  start date: May 27 20:20:05 2020 GMT
*  expire date: May 27 20:20:05 2022 GMT
*  subjectAltName: host "REDACTED" matched cert's "*.REDACTED"
*  issuer: C=US; ST=Arizona; L=Scottsdale; O=GoDaddy.com, Inc.; OU=http://certs.godaddy.com/repository/; CN=Go Daddy Secure Certificate Authority - G2
*  SSL certificate verify ok.
* Using HTTP2, server supports multi-use
* Connection state changed (HTTP/2 confirmed)
* Copying HTTP/2 data in stream buffer to connection buffer after upgrade: len=0
* Using Stream ID: 1 (easy handle 0x)
> GET /page/ HTTP/2
> Host: www.REDACTED
> User-Agent: curl/7.54.0
> Accept: */*
>
* Connection state changed (MAX_CONCURRENT_STREAMS updated)!
< HTTP/2 200
< server: nginx
< date: Thu, 26 Aug 2021 14:18:14 GMT
< content-type: text/html; charset=UTF-8
< content-length: 107571
< vary: Accept-Encoding
< vary: User-Agent,Accept-Encoding
< accept-ranges: bytes
< cache-control: max-age=0, public
< expires: Thu, 26 Aug 2021 14:18:14 GMT
< x-httpd: 1
< x-powered-by: WP Rocket/3.9.1.1
< host-header: 6b7412fb82ca5edfd0917e3957f05d89
< x-proxy-cache: MISS
< x-proxy-cache-info: 0 NC:000000 UP:SKIP_CACHE_MAX_AGE_ZERO
<
<!doctype html>
<html lang="en-US">
...

Thu, 26 Aug 2021 15:05:37 GMT : 301 redirect


➜  ~ curl -vv -H "user-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.182 Safari/537.36" https://REDACTED/page/
*   Trying X.X.X.X...
* TCP_NODELAY set
* Connected to www.REDACTED (X.X.X.X) port 443 (#0)
* ALPN, offering h2
* ALPN, offering http/1.1
* Cipher selection: ALL:!EXPORT:!EXPORT40:!EXPORT56:!aNULL:!LOW:!RC4:@STRENGTH
* successfully set certificate verify locations:
*   CAfile: /etc/ssl/cert.pem
  CApath: none
* TLSv1.2 (OUT), TLS handshake, Client hello (1):
* TLSv1.2 (IN), TLS handshake, Server hello (2):
* TLSv1.2 (IN), TLS handshake, Certificate (11):
* TLSv1.2 (IN), TLS handshake, Server key exchange (12):
* TLSv1.2 (IN), TLS handshake, Server finished (14):
* TLSv1.2 (OUT), TLS handshake, Client key exchange (16):
* TLSv1.2 (OUT), TLS change cipher, Client hello (1):
* TLSv1.2 (OUT), TLS handshake, Finished (20):
* TLSv1.2 (IN), TLS change cipher, Client hello (1):
* TLSv1.2 (IN), TLS handshake, Finished (20):
* SSL connection using TLSv1.2 / ECDHE-RSA-AES256-GCM-SHA384
* ALPN, server accepted to use h2
* Server certificate:
*  subject: OU=Domain Control Validated; CN=*.REDACTED
*  start date: May 27 20:20:05 2020 GMT
*  expire date: May 27 20:20:05 2022 GMT
*  subjectAltName: host "www.REDACTED" matched cert's "*.REDACTED"
*  issuer: C=US; ST=Arizona; L=Scottsdale; O=GoDaddy.com, Inc.; OU=http://certs.godaddy.com/repository/; CN=Go Daddy Secure Certificate Authority - G2
*  SSL certificate verify ok.
* Using HTTP2, server supports multi-use
* Connection state changed (HTTP/2 confirmed)
* Copying HTTP/2 data in stream buffer to connection buffer after upgrade: len=0
* Using Stream ID: 1 (easy handle 0x)
> GET /page/ HTTP/2
> Host: www.REDACTED
> Accept: */*
> user-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.182 Safari/537.36
>
* Connection state changed (MAX_CONCURRENT_STREAMS updated)!
< HTTP/2 301
< server: nginx
< date: Thu, 26 Aug 2021 15:05:37 GMT
< content-type: text/html; charset=UTF-8
< content-length: 0
< location: https://www.REDIRECTION/page/
< expires: Thu, 26 Aug 2021 15:29:14 GMT
< cache-control: max-age=3600
< x-redirect-by: redirection
< x-httpd: 1
< vary: Accept-Encoding
< host-header: 8441280b0c35cbc1147f8ba998a563a7
< x-proxy-cache: HIT
<
* Connection #0 to host www.REDACTED left intact
johngodley commented 2 years ago

If you deleted a redirect then it is no longer redirecting. You have tested with curl and it is correct. Your browser is caching the old redirect.