4

old permalink:

https://www.example.com/2019/cat/subcat/10/25/post-name/amp/

new permalink:

https://www.example.com/2019/10/25/cat/subcat/post-name/amp/

How can I redirectmatch the old format to the new one with htaccess?

  • 1
    This seems to have little to do with AMP and more to do with moving parts of the date around in the URL – Stephen Ostermiller Sep 15 at 20:13
  • Yeah..i'm a little lost to switching the order around in the URLs. – clarkeyo Sep 15 at 22:04
3

Tried the "Redirection" plugin and eventually figured out this for a solution.

Source:
^/([0-9]{4})/([^/]+)/([^/]+)/([0-9]{2})/([0-9]{2})/([^/]+)/amp/$
Target:
https://www.example.com/$1/$4/$5/$2/$3/$6/amp/

Change the option in the plugin to Regex.

  • Is it working now? – closetnoc Sep 16 at 1:43
  • Yes, that works. – clarkeyo Sep 16 at 1:46
  • Cool! Thanks for sharing. Cheers!! – closetnoc Sep 16 at 1:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.