Hi,
could someone guide me on one of the scenario which i have while writing RewriteRule for the below pattern?
Before:
/a/b/123456.html
/a/b/123456abc.html
/a/b/123456123.html
After (should be):
/a/b/12345x.html
/a/b/12345xabc.html
/a/b/12345x123.html
here, character on a specific position (here it's 6th) need to be replaced with another character (lets say 'x') with the help of rewriteRule and rewriteCond directive.
Question 1: can we use preg_match in .htaccess? if yes, then how can we? any example will certainly help me to write down the rule/condition and resolve my scenario.
Question 2: if preg_match can't be used, how can we achieve the same?
I'm using the below method using logical OR, however, i don't want to use this one as the character on specific position can change and also can't handle related patterns.
RewriteRule ^a/b/(12345)6(|abc|123).html$ /a/b/$1x$2 [NC,R=301]
Please guide.