I have a issue related to redirection
I want to apply redirection if someone uses http://mywebsite.com/
then the URL would be redirected to http://www.mywebsite.com/
. I know it is a 302 redirection but I dont know how to apply it in coding ........ what VBScript could be used for applying redirection ??
My website is build in Classic ASP and VBScript ... any piece of code would be better for me
Thanks
Use
Request.ServerVariables("HTTP_HOST")
to get the host part so that you can check if it starts withwww.
or not.If it doesn't then just issue a
Response.Redirect()
to the appropriate URL since it'll do a 302 for you:e.g.
The above does a redirect ensuring the requested page and querystring are preserved