开发者

response.Addheader not working anymore

i have a page for 404 error and the response.status is 404 yesterday the response.Addheader was working fine but today it is just showing a blank page and if i check the header status it is 404.

here is part of my code

Response.Status="404 Not Found"
Response.AddHeader "Location", doma开发者_如何学运维in & "/page-not-found"

in the same code - the 301 status works fine

IIS 7, vb script, classic asp


You could edit your web.config to redirect to there on 404...

<configuration>
   <system.web>
      <customErrors defaultRedirect="/page-not-found"
                    mode="RemoteOnly">
         <error statusCode="404"
                redirect="/page-not-found"/>
      </customErrors>
   </system.web>
</configuration>

Source:Web.config custom errors

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜