简体   繁体   English

经典的asp响应代码

[英]classic asp response code

We currently have a classic asp 404 error page. 我们目前有一个经典的asp 404错误页面。 By default, it's returning a status code 200 error, and we want it to return a 404 error code. 默认情况下,它返回状态代码200错误,我们希望它返回404错误代码。 How do you set the status code for a page in classic asp (vbscript)? 如何在经典asp(vbscript)中设置页面的状态代码?

使用Response对象:

Response.Status = "404 Not found"

Technically, 200 is a status code OK , not an error, but nevertheless, the basic idea is that you need to tell the Response stream to return 404 (Not found) for the status code. 从技术上讲,200是状态代码OK ,而不是错误,但是,基本的想法是你需要告诉Response流返回404(Not found)状态代码。 Here's one way to do that. 这是一种方法

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM