![]() |
How can I insert a long, random string into an Img Url
|
$solution = $PHP + .htaccess;
|
lotsa ways , depends on how your using it..
if you put an htacess in a folder called "stb" like this RewriteEngine on RewriteRule ^(.*)\.jpg http://www.yoursite.com/stb/img.php?in=$1 [nc] then in img.php in the same folder <?php $ein = explode("/",$in); $out = $ein[1]; header("Location: http://yoursite.com/secretfolder/$out.jpg"); ?> That would turn yoursite.com/stb/jg7y7iyikuiu6ujk7/test.jpg turn into yoursite.com/secretfolder/test.jpg |
All due props to smokey, but had to chime in - don't rely on the code above for anything valugely security related
By using Location, your brower makes the request to the 'secretfolder' - so finding out the secret folder is trivial. If that's not a problem, then you're sweet. Would be much faster to do a plain rewrite, though.. |
| All times are GMT -7. The time now is 07:12 AM. |
Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2026, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123