wordpress - matching only numbers in a regex string for redirect -



wordpress - matching only numbers in a regex string for redirect -

i using redirection plugin wordpress advertisement have no experience regex.

i have url can have after url, want redirect if numbers appear , nil else, such of next urls lastly 1 match:

http://j.net/contact http://j.net/c4t http://j.net/4con http://j.net/4co5 http://j.net/anything/123 * should fail http://j.net/456 * should pass

i came this:

(\d+)$

to:

article/$1

but ended in infinite loop.

edit: loop seems come play when navigating to:

http://j.net/1289

or:

http://j.net/dribble/1289

your solution seems work fine, after escaping / character see example: http://regex101.com/r/cx4bv6/2

ps. i'm not sure language using , whether wordpress back upwards it.

regex wordpress

Comments

Popular posts from this blog

Delphi change the assembly code of a running process -

json - Hibernate and Jackson (java.lang.IllegalStateException: Cannot call sendError() after the response has been committed) -

C++ 11 "class" keyword -