Redirection (302) A default redirection function of
IIS that redirects the visitor from the current page or site to another
page or site, while returning a response code that says that the
original page or site has been temporarily moved to
the new location. Search engines will often interpret these as a park,
and take their time figuring out how to handle the setup. Try to avoid
a 302 redirect on your site if you can (unless it truly is only a
temporary redirect), and never use them as some form of click tracking
for your outgoing links, as they can result in a "website hijacking"
under some circumstances.
Permanent Redirection (301) An optional function of
IIS that redirects the visitor from the current page or site to another
page or site, while returning a response code that says that the
original page or site has been permanently moved to
the new location. Search engines like this information and will readily
transfer link popularity (and PageRank) to the new site quickly and
with few issues. They are also not as likely to cause issues with
duplication filters. SEOs like 301 redirects, and they are usually the
preferred way to deal with multiple domains pointing at one website.
Let's say that you want to pass on some variables, for example, you
wanted to redirect an ASP site that accepted arguments for some pages
and pass those same arguments on to the same pages at the new site.
In this case, in the "Redirect to:" box, enter the domain you wish to move to (no trailing slash), plus $S$Q .
For example:
http://www.newdomain.com$S$Q
Next, check the options that state the client will be sent to "The exact URL entered above", as well as "A permanent redirection for this resource" (if you want it to be a 301). Done.
What does this $S$Q do? These are tags that IIS will automatically
replace - $S will be replaced with the subdirectory location (such as
/shopping/cart.aspx) and $Q will be replaced with the querystring (such
as ?id=Blue).
| Server Variable | Function | Example |
| $P | Passes parameters that were passed to the URL to the new URL. | If the request contains parameters such as http://www.oldsite.com/cart.asp?id=Blue , then $P would represent all the values after the question mark in the URL, example $P would equal id=Blue (no question mark). |
| $Q | Passes the parameters including the question mark. | This is the same as $P but includes the question mark or query string. So $P would equal ?id=Blue |
| $S | Passes the matching suffix of the URL to the new URL. | If the request is for http://www.oldsite.com/shopping/cart.asp, then $S represents /cart.asp. If the request was for http://www.oldsite.com/shopping then the value of $S would be /shopping |
| $V | Removes the server name from the original request. | If the request is for http://www.oldsite.com/shopping/cart.asp then $V would contain everything after the server name, eg: /shopping/cart.asp. |
| * | Wildcard symbol used for replacement. | Let's say you want to redirect all requests for html pages to a single asp page - you could do so in the following way: *;*.htm;page.asp |
This works for both Site Redirects and Individual Page Redirects.