Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/git/20.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Mod rewrite nginx重写下载而不是打开php文件_Mod Rewrite_Nginx - Fatal编程技术网

Mod rewrite nginx重写下载而不是打开php文件

Mod rewrite nginx重写下载而不是打开php文件,mod-rewrite,nginx,Mod Rewrite,Nginx,我将这些行添加到nginx中的virtual.conf中。重定向工作正常,但它下载文件而不是打开文件 rewrite ^/img-(.*).html /img.php?id=$1 last; rewrite ^/slide-(.*).html /slider.php?id=$1 last; rewrite ^/page-(.*).html /page.php?name=$1 last; rewrite ^/contact.html$ /contact.php last; 我正试图将其翻译为。h

我将这些行添加到nginx中的virtual.conf中。重定向工作正常,但它下载文件而不是打开文件

rewrite ^/img-(.*).html /img.php?id=$1 last;
rewrite ^/slide-(.*).html /slider.php?id=$1 last;
rewrite ^/page-(.*).html /page.php?name=$1 last;
rewrite ^/contact.html$ /contact.php last;
我正试图将其翻译为。htaccess到nginx:

Options +FollowSymlinks
Options -MultiViews
RewriteEngine On
RewriteBase /
RewriteRule ^img-(.*).html img.php?id=$1 [L]
RewriteRule ^slide-(.*).html slider.php?id=$1 [L]
RewriteRule ^page-(.*).html page.php?name=$1 [L]
RewriteRule ^contact.html$ contact.php [QSA,L,NC]

我猜…没有安装PHP?
我将尝试使用PHP info命令显示一个简单的页面。在这种情况下,谈论执行时最好不要打开

nginx很老了。我需要更新它。

是的,PHP已经安装并且运行良好。检查php信息屏幕截图的链接。