Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/.htaccess/6.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
Apache htaccess规则转换为NGINX不起作用_Apache_.htaccess_Mod Rewrite_Nginx - Fatal编程技术网

Apache htaccess规则转换为NGINX不起作用

Apache htaccess规则转换为NGINX不起作用,apache,.htaccess,mod-rewrite,nginx,Apache,.htaccess,Mod Rewrite,Nginx,我想在NGINX中转换这些简单的规则,我使用了这个网站()为我转换规则,但是不知怎么的,当我点击页面时,不是去页面而是下载页面 以下是一个例子: 我想将这些规则转换为NGINX: Options +FollowSymLinks RewriteEngine On RewriteRule ^play/(.*)$ play.php?show=$1 [L] RewriteRule ^category/(.*)$ category.php?show=$1 [L] RewriteRule ^contact/

我想在NGINX中转换这些简单的规则,我使用了这个网站()为我转换规则,但是不知怎么的,当我点击页面时,不是去页面而是下载页面

以下是一个例子:

我想将这些规则转换为NGINX:

Options +FollowSymLinks
RewriteEngine On
RewriteRule ^play/(.*)$ play.php?show=$1 [L]
RewriteRule ^category/(.*)$ category.php?show=$1 [L]
RewriteRule ^contact/(.*)$ contact.php [L]
RewriteRule ^contact$ contact.php [L]
RewriteRule ^terms/(.*)$ terms.php [L]
RewriteRule ^terms$ terms.php [L]
以下是网站给我的信息:

# nginx configuration
location /play {
rewrite ^/play/(.*)$ /play.php?show=$1 break;
}
location /category {
rewrite ^/category/(.*)$ /category.php?show=$1 break;
}
location /contact {
rewrite ^/contact/(.*)$ /contact.php break;
}
location = /contact {
rewrite ^(.*)$ /contact.php break;
}
location /terms {
rewrite ^/terms/(.*)$ /terms.php break;
}
location = /terms {
rewrite ^(.*)$ /terms.php break;
}
有人能帮我吗?
非常感谢

此处不能使用
break
。您应该使用
last

break
的目的是在当前位置块内继续处理。在上述每种情况下,您都需要处理以移动到
位置\.php$

有关详细信息,请参阅