小编use*_*593的帖子

nginx重写没有更改网址

我想在我的nginx服务器中使用重写功能.

当我尝试" http://www.example.com/1234 "时,我想重写" http://www.example.com/v.php?id=1234 "并希望获得" http:// www .example.com/1234 "在浏览器中.

这是nginx.conf文件

...
  location ~ /[0-9]+ {
      rewrite "/([0-9]+)" http://www.example.com/v.php?id=$1 break;
  }
...
Run Code Online (Sandbox Code Playgroud)

当我尝试" http://www.example.com/1234 "时

我想要 ...

url bar in browser : http://www.example.com/1234
real url : http://www.example.com/v.php?id=1234
Run Code Online (Sandbox Code Playgroud)

但我遇到了麻烦......

url bar in browser : http://www.example.com/v.php?id=1234
real url : http://www.example.com/v.php?id=1234
Run Code Online (Sandbox Code Playgroud)

rewrite nginx

24
推荐指数
1
解决办法
4万
查看次数

使用std :: set find和struct data

typedef struct Edge
{
    int v1, v2, w;
    bool operator <(const Edge &rhs) const{
        bool b = v1 < rhs.v1 || v2 < rhs.v2;
        return (b);
    }
} edge;


template <class T>
struct my_less
{
    bool operator()(const T& _Left, const T& _Right) const
    {
        return (_Left < _Right);
    }
};

int main(int argc, char *argv[])
{
    set <edge, my_less<edge> > F;

    edge e3 = { 3, 3, 3};
    edge e4 = { 3, 7, 3};
    edge e5 = { 2, …
Run Code Online (Sandbox Code Playgroud)

c++ equals std set comparator

3
推荐指数
1
解决办法
1422
查看次数

标签 统计

c++ ×1

comparator ×1

equals ×1

nginx ×1

rewrite ×1

set ×1

std ×1