Welcome! Log In Create A New Profile

Advanced

Rewite cond

Posted by xDDx 
Rewite cond
January 10, 2014 05:37PM
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



Edited 1 time(s). Last edit at 01/10/2014 05:39PM by xDDx.
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 191
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready