Mod rewrite nginx重写下载而不是打开php文件
我将这些行添加到nginx中的virtual.conf中。重定向工作正常,但它下载文件而不是打开文件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
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信息屏幕截图的链接。