Quantcast
Channel: Nginx Forum - How to...
Viewing all articles
Browse latest Browse all 4759

Rewite cond

$
0
0
Hello,

it's been several days I stuck.

I want nginx returns to a file when requested is not available and this by htaccess.

In my tests with local apache + htaccess it works perfectly, the server returns image.php when this file is available, otherwise it returns cropper.

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^image.php$ cropper.php [QSA,L]

But when I go on nginx, the server always returns the same file cropper when the image file is available.

/ / 1
if (!-f $request_filename){
set $rule_0 1$rule_0;
}
if (!-d $request_filename){
set $rule_0 2$rule_0;
}
if ($rule_0 = "21"){
rewrite ^/image.php$ /cropper.php last;
}

// 2
if (!-e $request_filename) {
rewrite ^/image.php$ /cropper.php last;
}

I am looking desperately for help

Viewing all articles
Browse latest Browse all 4759

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>