NOTE: following code is encircled with a RewriteCond/RewriteRule that skips the instances so they don't get went again following the redirect happens.

Why can't I get this test true?

RewriteCond %{REQUEST_FILENAME} ="/unique/test/test"
RewriteRule ^.*$ /match [R=301,L]

I am outputing everything using the following line and that i can clearly see what REQUEST_FILENAME is:

RewriteRule (.*) /test$1-filename-%{REQUEST_FILENAME}-URI-%{REQUEST_URI} [R=301,L]

however i can't have it to complement.

I had been initially trying to behave such as this to check if had modified the road in the original URI or otherwise, but since I am unable to obtain the above to check true, this definitely does not work:


In RewriteCond, variables are just broadened inside the first argument. So together with your RewriteCond you're really evaluating the need for REQUEST_FILENAME using the literal string %{REQUEST_URI}.

To complete that which you intended, you must do some trick:

RewriteCond %{REQUEST_FILENAME}#%{REQUEST_URI} ^([^#]+)#\1$