Use Response.Redirect when Classic ASP needs to send the browser to another URL. The destination may be an absolute URL or an application-relative location. See common redirect use cases before applying it.
The redirect must happen before response headers have already been committed to the client. Keeping buffering enabled makes it easier to redirect before buffered output is flushed.
Response.Redirect "https://www.sitename.com"
If page output has already been flushed and HTTP headers have been committed, ASP can no longer change those headers for a redirect. A typical error is:
Response object error 'ASP 0156 : 80004005'
Header Error
redirect.asp, line 15
The HTTP headers are already written to the client browser. Any HTTP header modifications must be made before writing page content.
Perform redirect decisions early in the request and before flushing output.
Author & Instructor at plus2net
I write and maintain practical tutorials on Python, PHP, SQL, JavaScript, HTML, jQuery, and web development at plus2net. The tutorials focus on clear explanations, working examples, and code that readers can test and adapt while learning.