這裏是我的.htaccess代碼如何通過圖像URL作爲參數在.htaccess
Options all -Indexes
<Files .htaccess>
order allow,deny
deny from all
</Files>
<IfModule mod_rewrite.c>
Options +FollowSymLinks
RewriteEngine On
RewriteBase/
RewriteRule ^thumb/(.*)$ thumb.php?imagePath=$1 [B]
</IfModule>
如果我輸入網址爲http://mydomain.com/thumb/image1.jpg
那麼它傳遞給thumb.php?imagePath=image.1
,其工作的罰款。
假設如果我輸入URL作爲http://mydomain.com/thumb/http://otherwebsite.com/images/image1.jpg
則其表示404錯誤。請幫我理清這個問題
,我用encodedurl太喜歡這個http://mydomain.com/thumb/http%3A%2F%2Fotherwebsite.com%2Fimages%2Fimage1.jpg
同我得到404錯誤。請幫我解決這個問題。
非常感謝你的工作:)但我有一個小小的懷疑是有htaccess代碼有安全漏洞?它會允許黑客的東西? – rkaartikeyan
不,我不認爲這有任何風險,如果你的thumb.php只是做圖像顯示工作。很高興它解決了。 – anubhava