nginx重写单个php页面

我真的很难理解和实现一个非常简单的操作在Nginx中。

我正在尝试重写以下页面:

http://test.domain.com/prova_pagina.php 

 http://test.domain.com/p/ 

我在nginx.conf中有以下内容:

 server { listen 82; root /dir; include /nginx/conf/mod_pagespeed.conf; include /nginx/conf/expiry_directives.conf; server_name test.domain.com; index theindex.php; location / { rewrite ^/d/ /prova_pagina.php last; } location ~ \.php$ { include /nginx/conf/fastcgi_params; fastcgi_index theindex.php; if (-f $request_filename) { fastcgi_pass 127.0.0.1:9000; } } } 

它实际上工作,但问题是所有的外部链接,如CSS和JS后得到/ D /附加在域。

任何帮助? 任何简单的教程,可以让我明白如何正确实现这一目标?

谢谢你的帮助。

试试像这样:

 # serving normal pages location / { try_files $uri $uri/ /index.php?$args; } # the page to be redirected location /prova_pagina.php { rewrite ^ http://test.domain.com/p/; }