nginx配置404重定向

2018-09-0220:00:40 评论 1,748 views

假设访问: http://www.fxian.org 其中的页面: ceshi.html(实际上该页面不存在)
即:http://www.fxian.org/ceshi.html
那么不存在的情况,我希望重定向到: error404.html
可以参考下面的位置配置:

server {
        location / {
                #配置错误页面:
                error_page 404 http://www.fxian.org/error404.html
        }
}

发表评论

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen: