Nginx pseudostatisch
过去多啦不再A梦
过去多啦不再A梦 2017-05-16 17:17:31
0
2
693

So schreiben Sie, wenn mehr als 10 pseudostatische Parameter vorhanden sind
rewrite /index/([a-z]+)-(d+)-(.)-(.)-(d+)-(.)-( .)- (d+)-1-1-(d+)-(d+)-(d+).html$ /index.php?type=$1&cid=$2&q=$3&commission=$4&volume=$5&price_start=$6&price_end =$7&sort= $8&tmall=1&only=1&jr_update=$9&jr_insert=$10&page=$11 last;
Die folgenden $10 werden in $1 0 geparst
Ich habe es mit ${10} versucht, aber es hat auch nicht funktioniert

Stellen und beantworten Sie Ihre eigenen Fragen, ich werde sie später posten!

Ich habe am Ende geflucht!
Baidu, das gefälschte Medikamente verkauft, bitte schnell schließen! Was nützen Sie! Die Suche empfiehlt nur gefälschte Medikamente! ! !
http://kzone.iteye.com/blog/1932104

rewrite /index/([a-z]+)-(d+)-(.)-(.)-(d+)-(.)-(.)-(d+)-1-1-(d+ )-(?<n0>d+)-(?<n1>d+).html$ /index.php?type=$1&cid=$2&q=$3&commission=$4&volume=$5&price_start=$6&price_end=$7&sort= $8&tmall=1&only=1&jr_update=$9&jr_insert=$n0&page=$n1 last;
rewrite /index/([a-z]+)-(d+)-(.)-(.)-(d+)-(. )-(.)-(d+)-0-0-(d+)-(?<n0>d+)-(?<n1>d+).html$ /index.php?type=$1&cid=$2 &q=$3&commission=$4&volume=$5&price_start=$6&price_end=$7&sort=$8&tmall=0&only=0&jr_update=$9&jr_insert=$n0&page=$n1 last;
rewrite /index/([a-z]+)-(d+)- (.)-(.)-(d+)-(.)-(.)-(d+)-1-0-(d+)-(?<n0>d+)-(?<n1> ;d+).html$ /index.php?type=$1&cid=$2&q=$3&commission=$4&volume=$5&price_start=$6&price_end=$7&sort=$8&tmall=1&only=0&jr_update=$9&jr_insert=$n0&page=$n1 zuletzt ;
rewrite /index/([a-z]+)-(d+)-(.)-(.)-(d+)-(.)-(.)-(d+)-0-1-( d+)-(?<n0>d+)-(?<n1>d+).html$ /index.php?type=$1&cid=$2&q=$3&commission=$4&volume=$5&price_start=$6&price_end=$7&sort =$8&tmall=0&only=1&jr_update=$9&jr_insert=$n0&page=$n1 last;

rewrite /index/([a-z]+)-(d+)-(.)-(.)-(d+)-(.)-(.)-(d+)-(d+)-1- (?<n0>d+)-(?<n1>d+).html$ /index.php?type=$1&cid=$2&q=$3&commission=$4&volume=$5&price_start=$6&price_end=$7&sort=$8&tmall =$9&only=1&jr_update=$n0&page=$n1 last;
rewrite /index/([a-z]+)-(d+)-(.)-(.)-(d+)-(.)-(. )-(d+)-(d+)-0-(?<n0>d+)-(?<n1>d+).html$ /index.php?type=$1&cid=$2&q=$3&commission=$4 &volume=$5&price_start=$6&price_end=$7&sort=$8&tmall=$9&only=0&jr_update=$n0&page=$n1 last;

过去多啦不再A梦
过去多啦不再A梦

Antworte allen(2)
PHPzhong

结贴,答案在我的问题里

过去多啦不再A梦

个人感觉这样些是不是有点太不美观了啊。可以考虑写个内部路由或者写个跳转规则也行吧,比如:
伪静态写成:

rewrite ^/(.*?) /index.php?location=$1 last;

php页面中添加规则:

$location = $_GET['location'];
$tag = '-';
$paramter_key = array('type', 'cid', 'q', 'commission', 'volume', 'price_start', 'price_end', 'sort', 'tmall', 'only', 'js_update', 'jr_insert', 'page');
$paramter_value = explode($tag, $location);

//url参数及对应值形成的数组
$paramter = array_combine($paramter_key, $paramter_value);
//也可以把数组形式打散为变量形式
extract($paramter);

/**
 * 使用变量
 * echo $paramter['type'];
 * or
 * echo $type;
 */
Beliebte Tutorials
Mehr>
Neueste Downloads
Mehr>
Web-Effekte
Quellcode der Website
Website-Materialien
Frontend-Vorlage
Über uns Haftungsausschluss Sitemap
Chinesische PHP-Website:Online-PHP-Schulung für das Gemeinwohl,Helfen Sie PHP-Lernenden, sich schnell weiterzuentwickeln!