【发布时间】:2014-07-22 11:12:42
【问题描述】:
我有一个问题,下面是服务器块。除最后一个位置块外,所有重写都运行良好。访问链接时。它给出了 404 错误。似乎找不到解决办法。
server
{
listen 80;
server_name fontistic.com;
location / {
root /var/www/fontistic.com/;
index index.html index.htm index.php;
}
location ~ \.html$ {
rewrite ^/(.*).html /$1.php last;
}
location /top_rated {
rewrite ^/top_rated/(.*)/$ /top_fonts.php?page=$1;
rewrite ^(.*)$ /top_fonts.php;
}
location /fonts {
rewrite ^/fonts/(.*)/(.*)$ /font_details.php?f=$1;
}
}
【问题讨论】:
标签: php nginx url-rewriting