LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   nginx rewrite url (https://www.linuxquestions.org/questions/linux-newbie-8/nginx-rewrite-url-4175417419/)

ubungu 07-18-2012 01:02 PM

nginx rewrite url
 
Hi everybody!

This is my rewrite condition in my nginx virtual host

In server {} block
PHP Code:

location /tools/ {
    if (!-
e $request_filename)
    {
        
rewrite ^/tools/(.*)$ /tools/index.php/$1 last;
        break;
    }


I known that will remove index.php

example mydomain.com/tools/index.php/controller will rewrite to mydomain.com/tools/controller

I guest $1 are controller, controller/function, controller/function/variable
Can you tell me is that true? :(

And the 'last' string in command mean?

if (!-e $request_filename) means (my opinion): don't exists file $request_filename, is that true?.
I thank this condition must be: if (-e $request_filename)
Please tell me what case is true

Sorry for my english is not good :D

Thank you very much!

ubungu 07-19-2012 08:51 AM

Please help me :(


All times are GMT -5. The time now is 04:51 PM.