0
我正在生成压缩图像时的查询字符串URL。将查询字符串URL转换为静态路径
例如example.com/img.php?compressed=image.jpg & w = 280
但我需要产生静态URL路径。
例如example.com/img/image.jpg/width_280
我使用下面的代码来构建查询字符串的URL:
require_once 'img.class.php';
$getImage = new GetImage();
$getImage->setCacheFolder(FOLDER_CACHE);
$getImage->setErrorImagePath(FILEPATH_IMAGE_NOT_FOUND);
$getImage->setJpegQuality(JPEG_QUALITY);
$img = $_GET["img"];
$width = -1;
$width = isset($_GET["w"])?$_GET["w"]:-1;
$height = isset($_GET["h"])?$_GET["h"]:-1;
$type = "";
if(isset($_GET["exact"])) $type = GetImage::TYPE_EXACT;
else if(isset($_GET["exacttop"])) $type = GetImage::TYPE_EXACT_TOP;
$getImage->showImage($img,$width,$height,$type);
是否有可能以任何方式产生静态URL来改变这种代码?
它必须是硬编码的,而不是mod_rewrite解决方案。
非常感谢提前!
B.
你是什么意思的静态网址? – gabo
对不起,我的意思是一个没有QS的URL路径。例如example.com/img/image.jpg/width_280 – bjc999
我不相信这将是可能的出来使用mod_rewrite –