更新时间:2022-12-27 08:10:35
通过 httpd.conf
启用 mod_rewrite 和 .htaccess 然后把这段代码放到你的 .htaccess
下DOCUMENT_ROOT
目录:
Enable mod_rewrite and .htaccess through httpd.conf
and then put this code in your .htaccess
under DOCUMENT_ROOT
directory:
Options +FollowSymLinks -MultiViews
# Turn mod_rewrite on
RewriteEngine On
RewriteBase /
RewriteRule ^(folder)/(img/[^.]+\.jpg)$ $1/some.php?img=$2 [L,QSA,NC]
确保:
http://example.com/folder/img/test.jpg