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

Rewrite Rules nginx/1.2.1 index.php?go=XXX to XXX.php

$
0
0
Hello,


I want to rewrite http://www.forExample.org/index.php?go=download to http://www.forExample.org/download.php
Execpt the index.php all file-extentions are .inc like download.inc.

"
index.php contains

<?
while (list ($var, $value) = each ($_REQUEST))
$$var = $value;


if(!isset($go))
$go = "index";
if(file_exists("$go.inc"))
include("$go.inc");
else
include("index.inc");
"

So I tried the the following line without success (vhost.conf):

rewrite ^/.php/([^/\.]+)/?$ /index.php?page=$1 break;
rewrite ^/(.*)\.php$ /?go=$1 redirect;
rewrite ^/(.*).php$ /?go=$1;
rewrite ([^index]+)\.php /index.php?go=$1 break;
rewrite ('/^([^index]+)\.php$ /?go=$1 break;
rewrite ([^index]+)\.php /index.php?go=$1 break;

then I tried a new location-Block

location ~ \index.php?go=$ {
if (!-f $request_filename) {
rewrite ^(.*)\?go=$ $1.php permanent; }
}

Also with no success.


Maybe someone can help me ;)

I want to do enter .php to get my content ;)

Viewing all articles
Browse latest Browse all 4759

Trending Articles



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