PHP/NGINX: 301 redirect


PHP/NGINX: 301 redirect

我在PHP中做了一个临时重定向,改变了标题。

然而,我想现在做一个简单的301页重定向直接在Nginx:

http://domain.com/example.php?var=value

:

http://domain.com/index.htm

我试着:

location / {
    index index.htm index.php;
    rewrite example.php?var=value / permanent;
}

但它不工作…

任何想法?

谢谢。

put (out of "location/{}"):

rewrite /example.php?var=value / permanent;

顺便说一下,PHP也有重定向301的方法