• Resolved expertimmodelarc

    (@expertimmodelarc)


    Hello,
    I discover BingBot is lookig for url in lowercase while they exist on my site in UPPERCASE.

    I tried to redirct those one trying to convert to lowercase with regex syntax
    Find: (.*)
    Replace:\L$1
    but this seems not recongnised by the tool.
    Where do I do a mistake ?

    Thanks.

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

    (@johnny5)

    I do not know if that is supported by PHP regular expressions.

    If ‘find’ is ‘source’, and ‘replace’ is ‘target’ then that will match every URL on your site and redirect it to itself, where it will then match again, and create an infinite loop.

    I would suggest you don’t do this.

    Thread Starter expertimmodelarc

    (@expertimmodelarc)

    Thanks

    in fact i did show only the active part.

    The full rule syntax is like :
    Source: ^/something/(.*).pdf
    Target: /something/\L$1.PDF

    Looking at PHP doc it seems the regex \u \U and \l \L are not supported in PHP regex. Because iIt exists strtoupper and strtolower functions for that need…

    Thread Starter expertimmodelarc

    (@expertimmodelarc)

    Hello,

    I just discover the “Dynamic URLs shortcodes” in the FAQ.
    [upper]data[/upper] – uppercase the data
    [lower]data[/lower] – lowercase the data
    [dashes]data[/dashes] – convert any underscores in the data to dashes
    [underscores]data[/underscores] – convert any dashes in the data to underscores
    which works perfectly
    Source: ^/something/(.*).pdf
    Target: /something/[upper]$1[/upper].PDF

    I should have gone thru your documentation …

    Thanks.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Regexex lower case \L not recognized’ is closed to new replies.