Log in Sign up

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.


7 months ago, 8 replies   Edit question

I'd recommend just doing something like this:

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

Does that work?

Answered 7 months ago · Edit answer

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

Answered 7 months ago · Edit answer

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.

Answered 7 months ago · Edit answer

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...

Answered 7 months ago · Edit answer

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.

Answered 7 months ago · Edit answer

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".

Answered 7 months ago · Edit answer

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

Ray

Answered 7 months ago · Edit answer

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

Answered 7 months ago · Edit answer