[thelist] ASP Response.redirect

Warden, Matt mwarden at mattwarden.com
Sat Jun 15 18:13:00 CDT 2002


On Jun 15, Jason Cartwright had something to say about [thelist] ASP...

>Hi all,
>
>I believe that response.redirect in ASP uses a 302 (Moved Temporarily)
>to redirect the user to a location.
>
>What difference does a 301 (Moved Permanently) do?

It's just a different header. Clients may or may not act on it
differently. in some cases, clients like search engine spiders will update
their old links

>I'm changing a site's
>URLs permanently so I guess that would be preferable in this case. How
>do I get the ASP to return a 301?

you could try setting a Status header:

response.addheader "Status", "301"
response.addheader "Location", "http://absolute/url/to/new/file.asp"

but I'm not sure that ASP has access to the given status code other than
through response.redirect. response.redirect generates a pre-defined
response (in other words, no other code on the page affects the response),
so you couldn't change the status code through script. you may want to
look into a possible option in IIS (that pre-defined response has to be
stored somewhere, right?).


hth,

--
mattwarden
mattwarden.com




More information about the thelist mailing list