NOTE: THIS RESPONSE DOES NOT APPLY TO IIS TRANSMISSION PLACEMENT (httpRedirect) versus URL Rewrite URL redirection, but rather the difference between URL rewrite (redirect and rewrite).
If you are trying to hide a complex URL (with querystrings) with friendlier URLs, then Rewrite is the way it would look like this: the browser / search engines will always see 200OK and assume that the content comes from the requested source URL.
If you are trying to indicate a resource change to the search engines / users of the new URL, then the redirect is the path where you send the 301 status code, saying that the resource has moved from the source to this new location.
IIS Redirection:
- Redirection occurs on the client side
- The browser sees a different address in the address bar.
- The client knows the redirect URL.
- 301/302 may be issued. Edit: (303/307 may also be released)
- Good for SEO / search engine to specify a new URL. mysite.com/abc to mysite.com/pqr
- You can redirect to the same site or to another site as a whole.
IIS Rewrite:
- Redirection occurs on the server side.
- The browser does not see the new address in the address bar.
- The client does not know whether the content will be sent from the rewritten URL.
- No 301/302. This will be normal 200 OK, assuming a rewritten URL resource is available.
- Itβs good to hide hostile URLs as well as SEO. mysite.com/article/test-sub/to mysite.com/article.aspx?id=test-sub
- Usually for a resource on one site.
Request Processing (REDIRECT): www.mysite.com/abc to redirect to www.mysite.com/pqr
- Customer Calls: www.mysite.com/abc
- The Rewrite URL module sees the matching rule for the client URL and gives a new redirect URL.
- The server responds with a 301 new URL to be called by the client www.mystite.com/pqr
- The client calls the new URL www.mystite.com/pqr
- The server receives 200 OK for the new URL. (the address bar shows the new URL)
Request Processing (REWRITE): www.mysite.com/abc, which you want to point to www.mysite.com/pqr
- Customer Calls: www.mysite.com/abc
- The Rewrite URL module sees the compliance of the rule and provides a new rewritten IIS URL, for example www.mysite.com/pqr, and the server requests this URL in IIS.
- The server responds with 200 OK for the source URL, but with content from the rewritten URL. (the address bar shows the source URL, but the client does not know that you are serving content from a different URL).
source share