regex that matches URL to image than replaces characters -
hi long time reader first time poster regex question
i have rewrite rules in xml file this notation
<rule> <from></from> <forward></forward> </rule> in node, looking match url has image extension @ end , dash "-" characters in name. if matches, in forward node replace dash "-" characters underscore characters "_"
for example
longurl/test-image.jpg go longurl/test_image.jpg
you can try on top of .htaccess
rewriterule ^(.*)(\-|%2d)(.*)$ /$1_$3
Comments
Post a Comment