Apache htaccess规则转换为NGINX不起作用
我想在NGINX中转换这些简单的规则,我使用了这个网站()为我转换规则,但是不知怎么的,当我点击页面时,不是去页面而是下载页面 以下是一个例子: 我想将这些规则转换为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/
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$
块
有关详细信息,请参阅