Apache 2.4.34 PHP FPM重写问题



Apache Congig

<Directory  /var/www/vhosts/avoclub/htdocs/avobb>
Options -Indexes +FollowSymLinks -ExecCGI +MultiViews
AllowOverride All
<IfModule mod_proxy_fcgi.c>
RewriteEngine On
RewriteBase /
RewriteOptions InheritBefore
RewriteCond %{REQUEST_FILENAME} -f
#RewriteRule ^([^.]+.php)$ fcgi://127.0.0.1:9056/$1
RewriteRule ^([^.]+.php)$ fcgi://127.0.0.1:9056/var/www/vhosts/avoclub/htdocs/avobb/$1 [L,P]
</IfModule>
Order allow,deny
allow from all
<IfVersion >= 2.4>
Require all granted
</IfVersion>
</Directory>

我想做的是,我有一个图像脚本,它会在图像上加水印并显示

.htaccess文件

Options -Indexes
Options +FollowSymLinks
ReWriteEngine On
RewriteRule ([a-zA-Z0-9_]*.(jpg|png)) ./image.php?filename=$1
<Files "logfile.log">
Order allow,deny
Deny from all
</Files>

它应该:(请求一个图像文件。htaces将其重写为image.php、watermarkimage和display。

但当你做时

https://bbs.avoclub.com/documents/how_too/RS2_Clutch_7.jpg

你得到的文件找不到。

帮助

移动

<IfModule mod_proxy_fcgi.c>
RewriteEngine On
RewriteBase /
RewriteOptions InheritBefore
RewriteCond %{REQUEST_FILENAME} -f
#RewriteRule ^([^.]+.php)$ fcgi://127.0.0.1:9056/$1
RewriteRule ^([^.]+.php)$ fcgi://127.0.0.1:9056/var/www/vhosts/avoclub/htdocs/avobb/$1 [L,P]
</IfModule>

<Directory>区块外!已排序

蓝色