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

Popular posts from this blog

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -

php - Controller/JToolBar not working in Joomla 2.5 -