Blot

Redirect not working

Trying to redirect from incoming pattern with a date to just the name of the post so that this: https://blog.jasonkratz.me/2023/11/08/my-default-apps-2023 should be this: https://blog.jasonkratz.me/my-default-apps-2023

Trying with:

from: /\d{4}/\d{2}/\d{2}/(.*) to: /$1

Tried escape version of the above as well and its not working. The title definitely matches so not sure what is going on and we have no logging to see what might be going wrong.

Asked 3 years ago Edit
8 replies

I'd recommend just doing something like this:

from: /(.*)/(.*)/(.*)/(.*) to: /$4

Does that work?

3 years ago Edit

It does not. Still get a 404 for the original URL.

3 years ago Edit

So if I hit that URL mentioned above I get a page not found but the URL stays the same in the URL bar. If I change the year it actually redirects to https://blog.jasonkratz.me/$4 which is...odd.

3 years ago Edit

Ah, there's probably a cache issue here. Try adding a space to your site's title, then removing the space, this purges the cache.

I need to make it so new redirects purge the cache...

3 years ago Edit

Tried that. No luck. However, I did set it back to the example I gave above and used an incognito/private window and it worked.

3 years ago Edit

Something weird going on with Chrome? New profile/incognito works. Other browsers work. Its still redirecting to /$4 even though I changed the regex and the "to" is now "$1".

3 years ago Edit

FYI I can confirm the redirect (using above URLs) worked for me my Mac's Safari, Firefox, and Arc (Chromium).

Ray

3 years ago Edit

Thanks Ray. Also confirmed myself that it was working with everything but the main Chrome profile I've been using 😂 Now just confirmed that its working even with that profile so not sure if David did something or the caches just expired finally. Either way thanks for the help all!

Jason

3 years ago Edit

Your reply