<html><head></head><body><div style="color:#000; background-color:#fff; font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:16px"><div dir="ltr" id="yui_3_16_0_1_1447251376430_3096">Hi there,<br class="" id="yui_3_16_0_1_1447251376430_3139" clear="none"><br class="" id="yui_3_16_0_1_1447251376430_3141" clear="none">> I have checked many ways
 to implement what I want (including if is evil) and I've been able to 
reach what I wanted to do (something simple)<br class="" id="yui_3_16_0_1_1447251376430_3143" clear="none">> I want
 that a user who accessesnginx.org/informationwill be redirected in the 
background tonginx/index.php?x=informationSo that my index.php page is 
dymanic<br class="" id="yui_3_16_0_1_1447251376430_3145" clear="none"><br class="" id="yui_3_16_0_1_1447251376430_3147" clear="none">What does "redirected in the background" mean?</div><div id="yui_3_16_0_1_1447251376430_3250" dir="ltr">M => I just meant that the user won't see the php parameters. He just sees a simple url with text only.</div><div id="yui_3_16_0_1_1447251376430_3306" dir="ltr">Nginx passes the parameter to php, and not the user (through GET). That's what I meant by "in the background"<br></div><div id="yui_3_16_0_1_1447251376430_3284" dir="ltr"><br class="" id="yui_3_16_0_1_1447251376430_3151" clear="none">I suspect it refers to an nginx internal rewrite, rather than to a<br class="" id="yui_3_16_0_1_1447251376430_3153" clear="none">http redirect.</div><div id="yui_3_16_0_1_1447251376430_3347" dir="ltr">M => Maybe I didn't used the correct words. <br></div><div id="yui_3_16_0_1_1447251376430_3368" dir="ltr"><br class="" id="yui_3_16_0_1_1447251376430_3157" clear="none">> I did like this in my virtual host configurationlocation /information { try_files information /index.php?x=information; }<br class="" id="yui_3_16_0_1_1447251376430_3159" clear="none">> I would like to know if:a) This is the best practice to do what I would like to do ?<br class="" id="yui_3_16_0_1_1447251376430_3161" clear="none"><br class="" id="yui_3_16_0_1_1447251376430_3163" clear="none">I'd say "no".<br class="" id="yui_3_16_0_1_1447251376430_3165" clear="none"><br class="" id="yui_3_16_0_1_1447251376430_3167" clear="none">I'm not fully sure what it is that you want to do, but I suspect that<br class="" id="yui_3_16_0_1_1447251376430_3169" clear="none">"rewrite" (<a class="" id="yui_3_16_0_1_1447251376430_3171" shape="rect" href="http://nginx.org/r/rewrite" target="_blank">http://nginx.org/r/rewrite</a>) may be what you want; unless<br class="" id="yui_3_16_0_1_1447251376430_3173" clear="none">you will describe how /index.php is intended to be handled -- in which<br class="" id="yui_3_16_0_1_1447251376430_3175" clear="none">case just using (e.g.) fastcgi_pass with some suitable fastcgi_param<br class="" id="yui_3_16_0_1_1447251376430_3177" clear="none">directives might be even better.</div><div id="yui_3_16_0_1_1447251376430_3416" dir="ltr"><br></div><div id="yui_3_16_0_1_1447251376430_3437" dir="ltr">M => My index.php looks like this</div><div id="yui_3_16_0_1_1447251376430_3544" dir="ltr"><?php<br></div><div id="yui_3_16_0_1_1447251376430_3438" dir="ltr">if ($_GET['x']) == 'information') { echo "This is the information Page"; } <br></div><div id="yui_3_16_0_1_1447251376430_3492" dir="ltr">if ($_GET['x']) == 'contact') { echo "This is the contact Page"; } <br></div><div id="yui_3_16_0_1_1447251376430_3545" dir="ltr">?><br></div><div id="yui_3_16_0_1_1447251376430_3490" dir="ltr"><br class="" id="yui_3_16_0_1_1447251376430_3181" clear="none">>
 b) If "location /information" is an exact match only. Apparently no 
because nginx.org/informationxxxsomethingxxxweird also matches<br class="" id="yui_3_16_0_1_1447251376430_3183" clear="none"><br class="" id="yui_3_16_0_1_1447251376430_3185" clear="none">It is not an exact match.<br class="" id="yui_3_16_0_1_1447251376430_3187" clear="none"><br class="" id="yui_3_16_0_1_1447251376430_3189" clear="none"><a class="" id="yui_3_16_0_1_1447251376430_3191" shape="rect" href="http://nginx.org/r/location" target="_blank">http://nginx.org/r/location</a><br class="" id="yui_3_16_0_1_1447251376430_3193" clear="none"></div>  <br>M => Thank you I added = in order to have an exact match<br></div></body></html>