Question

Can anyone tell me how to replace first double underscore('__') with a value like '_2000'.

www.mysite.com/abc/Price_10000__10500__ -- this should be changed to www.mysite.com/abc/Price_10000_2000_10500__

Note that none of the data is static except 'Price_' in the URL.

Thanks

Was it helpful?

Solution

You can try this rule:

RewriteRule ^([^/]+)/(Price_\d+)__(\d+.*)$ /$1/$2_2000_$3 [L,NC,R]
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top