Skip to content

Instantly share code, notes, and snippets.

@dylan-k
Last active February 1, 2016 21:08
Show Gist options
  • Save dylan-k/6132613 to your computer and use it in GitHub Desktop.
Save dylan-k/6132613 to your computer and use it in GitHub Desktop.
Redirect
redirect
REDIRECT This is some language for use in an .aspx file. It will send a 301 "moved" response and redirect to the location of your choosing. Just change that URL in there to whatever you want.
<%
Response.Status="301 Moved Permanently"
Response.AddHeader ("Location", "http://www.EXAMPLE.com")
Response.End()
%>
...sometimes the URL you're trying to redirect contains a variable. Try something like this
<%
Response.Status="301 Moved Permanently"
Response.AddHeader ("Location", "http://thewalters.org/news/releases/article.aspx?newvariable=" & request.querystring("oldvariable"))
%>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment