• Resolved tracian

    (@tracian)


    Hi there!

    I have to fix a website that changed its permalink structure.

    The original used the [domain][category1,2,3,…][post title] structure, while
    the new structure is [domain][post title]

    I guess my best bet is regexing this to death, with something like “delete everything between the domain name and the post title”… but I have no clue about how to actually write a working expression for this.

    Can anybody please help?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter tracian

    (@tracian)

    Hi there!

    I have to fix the internal links of a website that changed its permalink structure.

    The original used the

    [domain]/[parent category]/[subcategory]/[possible further subcategory…]/[post title] structure,

    while the new structure is [domain]/[post title]

    To complicate things up, this is a multilingual website, so the URL structure can be either [domain] or [domain]/it/ .

    I guess my best bet is regexing this to death, with something like “delete everything between the domain name and the post title”… but I have no clue about how to actually write a working expression for this.

    Can anybody please help?
    Please note that this is about the URLs used within the posts text, so it is really a text substitution question more than a WordPress issue.

    • This reply was modified 4 years, 7 months ago by tracian.
    • This reply was modified 4 years, 7 months ago by tracian.
    Plugin Author John Godley

    (@johnny5)

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Using regex to redirect around a permalink change?’ is closed to new replies.