nginx pseudo-static
过去多啦不再A梦
过去多啦不再A梦 2017-05-16 17:17:31
0
2
690

How to write more than 10 pseudo-static parameters
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;
The following $10 will be parsed into $1 0
I tried ${10} That doesn’t work either

Ask and answer your own questions, I’ll post them later!

I am cursing at the end!
Baidu, which sells fake medicines, should close down soon! What's the use of you! Search will only recommend fake medicines! ! !
http://kzone.iteye.com/blog/1932104

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=$n0&page=$n1 last;
rewrite /index/([a-z]+)-(d+)-(.)-(.)-(d+)-(.)-(.)-(d+)-0-0-(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=0&only=0&jr_update=$9&jr_insert=$n0&page= $n1 last;
rewrite /index/([a-z]+)-(d+)-(.)-(.)-(d+)-(.)-(.)-(d+)-1-0-(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=0&jr_update=$9&jr_insert=$n0&page=$n1 last;
rewrite /index/([a-z]+)-(d+)-( .)-(.)-(d+)-(.)-(.)-(d+)-0-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=0&only=1&jr_update=$9&jr_insert =$n0&=$n1 last;

rewrite /index/([a-z]+)-(d+)-(.)-(.)-(d+)-(.)-(.)- (d+)-(d+)-1-(?d+)-(?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-(?d+)-(?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梦

reply all (2)
PHPzhong

Posted, the answer is in my question

    过去多啦不再A梦

    Personally, I feel like this is a bit too unsightly. You can consider writing an internal route or a jump rule, for example:
    Pseudo-statically written:

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

    Add rules to php page:

    $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; */
      Latest Downloads
      More>
      Web Effects
      Website Source Code
      Website Materials
      Front End Template
      About us Disclaimer Sitemap
      php.cn:Public welfare online PHP training,Help PHP learners grow quickly!