The Little Guy Posted August 22, 2008 Share Posted August 22, 2008 How can I rewright this: http://mysite.com/process/build/newTempImg.php?url=http://tzfiles.com/images/logo.gif To this: http://mysite.com/process/build/url/http://tzfiles.com/images/logo.gif Link to comment https://forums.phpfreaks.com/topic/120874-solved-jpgpnggif-to-php/ Share on other sites More sharing options...
corbin Posted August 22, 2008 Share Posted August 22, 2008 Easiest way would just be: RewriteEngine On RewriteRule url/(.*) newTempImg.php?url=$1 That would of course cause problems though if someone tried to tamper with the URL. Simple example. How specific do you want it? Do you want to make sure it's a valid URL in PHP or during the rewriting? Link to comment https://forums.phpfreaks.com/topic/120874-solved-jpgpnggif-to-php/#findComment-623341 Share on other sites More sharing options...
The Little Guy Posted August 23, 2008 Author Share Posted August 23, 2008 It MUST have a jpg, gif, or png, extention My php checks to see if it is an image, if not, nothing will happen. Link to comment https://forums.phpfreaks.com/topic/120874-solved-jpgpnggif-to-php/#findComment-623569 Share on other sites More sharing options...
corbin Posted August 23, 2008 Share Posted August 23, 2008 RewriteEngine On RewriteRule url/(.*)\.(jpg|gif|png) newTempImg.php?url=$1\.$2 Link to comment https://forums.phpfreaks.com/topic/120874-solved-jpgpnggif-to-php/#findComment-623851 Share on other sites More sharing options...
The Little Guy Posted August 24, 2008 Author Share Posted August 24, 2008 Thanks! works Link to comment https://forums.phpfreaks.com/topic/120874-solved-jpgpnggif-to-php/#findComment-624083 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.