I guess you could say that this little snippet could only be used by me for certain scripts... Then again, I needed it, so someone else out there may need it, too.
Basically it is .htaccess to change
http://www.ensellitis.com/img/http://example.com/image.gif
into
http://www.ensellitis.com/img/index.php?image=http://example.com/image.gif
Just another URL rewrite tweak.
-
Options +FollowSymlinks
-
RewriteEngine on
-
RewriteRule ^([a-zA-Z:]+)\/\/(.*)$ /img/index.php?Image=$1\/\/$2
([a-zA-Z:]+) looks for any letter a through z (capitalized or not) with a trailing :. So basically http:
\/\/ is the // in http:// (escaped, of course).
(.*) looks for any letter, character, or number.
The $1 and $2 prints their respective searches.
If you are interested in writing your own .htaccess URL rewrites, or anything htaccess related for that matter, head on over to this place or this place. They saved my ass a time or two.
Good luck figuring out regular expressions, I still strugal with it. I need to write up a tutorial, just so I can understand it.




