I have 2 vps :
- Centos 7 / Php 7.0 / Apache 2.4.6
- Ubuntu 18 / Php 7.2 / Apache 2.4.29
Both installed with VestaCP same config (apache as backend , nginx as frontend).
There are same script, which doesnt work on 2nd server.
.htaccess rule:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_URI} \.(jpg|jpeg|png|gif)$ [NC]
RewriteCond %{REMOTE_ADDR} !^(127.0.0.1)$ [NC]
RewriteCond %{HTTP_USER_AGENT} (bad|useragents) [NC]
RewriteRule (.*) script.php?src=$1 [L]
</IfModule>
Note :
- apache mod_rewrite is ON and works
- direct execute of script works
What it could be? I tried to debug apache logs, finding reason why request doesnt redirect, but apache LogLevel debug haven't shown any errors.
REMOTE_ADDRresolving as127.0.0.1due to your front-end. Compare the NGINX configurations