【发布时间】:2017-02-05 18:01:01
【问题描述】:
我想在 NGINX 中转换这些简单的规则,我使用这个网站 (https://winginx.com/en/htaccess) 为我转换规则,但不知何故,当我点击它时,不是去页面而是下载页面。
示例如下:
我想将这些规则转换为 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;
}
有人可以帮助我吗? 非常感谢!
【问题讨论】:
标签: apache .htaccess mod-rewrite nginx