Header Location not redirecting

staythesame

New Member
I'm trying to redirect a user to another page using a Location Header, with a 410 or 404 header status, but it's failing to redirect. If I change the Location Header to a Response.Redirect, it works fine.\[code\]Set rs1 = conn.Execute("SELECT status FROM blog_articles WHERE article_id = "&Request.QueryString("id")&";")If NOT rs1.EOF Then article_status = rs1.Fields("status") If article_status = "Deleted" Then Response.Status = "410 Gone" Response.Header "Location", "https://mydomain.com/error/410.html" End IfElse Response.Status = "404 Not Found" Response.Redirect "Location", "https://mydomain.com/error/404.html"End Ifrs1.Close : Set rs1 = Nothing\[/code\]This doesn't sit immediately at the top of the page, but there's not much above it - just a VbScript function and DOC TYPE tags:\[code\]<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%><!-- #include file = "../asp/db-conn.asp" --><!-- #include file = "../asp/auto-login.asp" --><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><%... my asp ...\[/code\]Any ideas how to resolve this?
 
Back
Top