• Resolved osmxnxn

    (@osmxnxn)


    Hello, I can’t seem to create a Regex for subdirectories to close all links with subdirectories. I have pages on my site like:

    domain.com/en/article1/

    domain.com/fr/article3/

    domain.com/es/article2/

    I can’t seem to get all the links with language subdomains to return a 410 code. Please help me solve the problem.

    • This topic was modified 1 year, 4 months ago by osmxnxn.
Viewing 1 replies (of 1 total)
  • Plugin Author alpipego

    (@alpipego)

    Hi @osmxnxn,
    if you want only the languages you mentioned above, the regex would look like this ^(?:en|es|fr)/ if you want it to be any two letter string, it would be ^[a-z]{2}/. You need to make sure that you’re not breaking any other URLs in the latter case, e.g., custom post types that have a two letter slug.

    Best regards,
    Alex

Viewing 1 replies (of 1 total)

The topic ‘Regular expression for subdirectories’ is closed to new replies.