Avatar of jahlife
jahlifeFlag for United States of America asked on

Change ASP Response.Redirect from 302 to 301

Right now, our response.redirect commands are generating a 302 response code.  We need to code, in ASP, a response.redirect stmt so that it returns a status code = 301 instead of 302.  We can test using fiddler.exe, to verify the return code is 301.

Any ASP/VBScript or javascript example will be very useful.

Greetings.
ASPVB ScriptJavaScript

Avatar of undefined
Last Comment
jahlife

8/22/2022 - Mon
ASKER
jahlife

Here is a sample trace of current status. note the second redirect that we want to alter for 301:

SEO Consultants Directory Check Server Headers - Single URI Results
Current Date and Time: 2008-05-23T12:19:54-0700
User IP Address: 64.147.222.37

#1 Server Response: http://bizamajig.com
HTTP Status Code: HTTP/1.1 301 Moved Permanently
Connection: close
Content-Length: 149
Date: Fri, 23 May 2008 19:19:55 GMT
Location: http://www.bizamajig.com//
Content-Type: text/html
Server: Microsoft-IIS/6.0
X-Powered-By: ASP.NET
Redirect Target: http://www.bizamajig.com//

#2 Server Response: http://www.bizamajig.com//
HTTP Status Code: HTTP/1.1 302 Object moved
Connection: close
Content-Length: 130
Date: Fri, 23 May 2008 19:19:55 GMT
Location: bizamajig
Content-Type: text/html
Server: Microsoft-IIS/6.0
X-Powered-By: ASP.NET
Set-Cookie: ASPSESSIONIDQSBQCQDC=MOOHBJIDHHHPJBKPIJOJFDNC; path=/
Cache-control: private
Redirect Target: bizamajig
ASKER CERTIFIED SOLUTION
hielo

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
See how we're fighting big data
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
ASKER
jahlife

Replace "response.redirect" with above tonic?
hielo

Place what I gave you at the top of your asp page. If your page already contains
<%@ Language=VBScript %>

don't include it again.
This is the best money I have ever spent. I cannot not tell you how many times these folks have saved my bacon. I learn so much from the contributors.
rwheeler23
ASKER
jahlife

Hielo, thanks everytime.