简体   繁体   中英

htaccess rewrite regex issue wildcard

This should be fairly easy for all regex gurus, however we are having issues with it.

I need a htaccess rewrite rule for following constellations...

"domain.tld/P123A123B123C123" -> points to index.php?pos=P123A123B123C123

or

"domain.tld/P1A2B3C4"  -> points to index.php?pos=P1A2B3C4

...the min length of numbers are 1 and max. length 3 (1-9)

note: a check for chars PABC to exist on url is required.

希望这应该工作:

RewriteRule domain\.tld\/P\d{1,3}A\d{1,3}B\d{1,3}C\d{1,3}$ index.php?pos=$1

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM