Forum Moderators: phranque
RewriteCond %{QUERY_STRING} ^(.*&)?p=image&url=media/([^&]+)(&.*)?$ [NC]
RewriteRule ^index\.php$ http://www.s3.example.com/media/%2? [NC,L,R]
#RewriteCond %{QUERY_STRING} ^(.*&)?i=media/([^&]+)(&.*)?$ [NC]
#RewriteRule ^thumb\.php$ http://www.s3.example.com/thumb.php?i=media/%2? [NC,L,R]
RewriteCond %{QUERY_STRING} ^(.*&)media/([^&]+)(&.*)?$ [NC]
RewriteRule ^media$ http://www.s3.example.com/media/%2? [NC,L,R][NC,L,R]
[edited by: incrediBILL at 4:18 am (utc) on Jul 2, 2012]
[edit reason] fixed URLS, use Example.com [/edit]
RewriteCond %{QUERY_STRING} ^(.*&)?p=image&url=media/([^&]+)(&.*)?$ [NC]
RewriteRule ^index\.php$ http://www.example.com/media/%2? [NC,L,R]
RewriteCond %{QUERY_STRING} (^|&)p=image&url=media/([^&]+)(&|$) [NC]
RewriteRule ^(index\.php)?$ http://www.example.com/media/%1? [R=301,L] p=image is not immediately before url= [edited by: incrediBILL at 4:16 am (utc) on Jul 2, 2012]
[edit reason] fixed URLS, use Example.com [/edit]
#RewriteCond %{QUERY_STRING} (^|&)i=media/([^&]+)(&|$) [NC]
#RewriteRule ^(thumb\.php)?$ http://www.s3.example.com/thumb.php?i=media/%2? [R=301,L]
[edited by: gunz at 3:00 pm (utc) on Jun 29, 2012]
d= parameter in another backreference. ^thumb\.php to the new hostname and path. RewriteCond to detect that the requested QUERY_SRING contains (^|&)d=160x160(&|$) [R=301,L] flags and the query string will be automatically re-appended unaltered.
s3.example.com/thumb.php?%3f
RewriteCond %{QUERY_STRING} (^|&)/media/(&|$) [NC]
RewriteRule ^(media)$ http://www.s3.example.com/media/ [R=301,L]