• Resolved Michael

    (@whispardesign)


    Hello John,

    Long time user – thanks for your dev efforts!
    Quick question. I am about to redesign/develope an older site with an uneditable custom theme. It is also using the day/name permalink structure. The site only has about 30 pages but 2800+ blog posts. I want to change permalinks to post name.

    I will install redirection prior to doing anything but what is best practice for this using redirection?
    Thanks!

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author John Godley

    (@johnny5)

    Thread Starter Michael

    (@whispardesign)

    Hello John – thank you – I meant to post that I should have scrolled down the page further – oversight on my part.

    I added:

    SOURCE URL ^/\d{4}/\d{2}/\d{2}/(.*)
    TARGET URL /$1/
    REGEX

    That did the trick but I also had to change permalinks:
    From /%postname%/
    TO /blog/%postname%/

    I added:

    SOURCE URL /^/(?!blog)(.*)
    TARGET URL /blog/$1
    REGEX

    Any backlinks from posts on the web that have the old Day/Name format result in a 404. They worked fine until I change permalinks a second time to /blog/%postname%/

    What am I missing here?
    Thanks John

    Edit: Perhaps this was too obvious ??
    I modified the original redirect as follows:
    SOURCE URL ^/\d{4}/\d{2}/\d{2}/(.*)
    TARGET URL /Blog/$1/
    REGEX

    After a cache clear it appears to be working. (Unless I missed something – if so let me know)

    • This reply was modified 4 years, 3 months ago by Michael.
    • This reply was modified 4 years, 3 months ago by Michael.
    • This reply was modified 4 years, 3 months ago by Michael.
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘301 when Changing Permalinks’ is closed to new replies.