bahman
bahman

Reputation: 1

Handle the httpmodule in iis

If you see the yahoo site, when you enter www.yahoo.com, the yahoo server gets your IP, and redirects you to the specific domain (yahoo.ca,yahoo.us,....)

Now, I want do this,Not for special site, I want to get any request send to iis (www.1.com,www.2.com,www.3.com) and with the algorithm, redirect user to the new site for example:

 Request: www.1.com GO To -> www.yahoo.com
 Request: www.2.com GO To -> www.google.com
 ....

I want handle IIS, no each webconfig's site.

Can anybody help me?

Upvotes: 0

Views: 421

Answers (2)

dash
dash

Reputation: 91480

In addition to Afshin's answer versus discovering a user's geographical location also look at this.

Unfortunately, a HTTP Module only works at the web site level; to do what you need you have to look at ISAPI_Filters.

See http://msdn.microsoft.com/en-us/library/ms972974.aspx for more information.

We ended up buying a product linked from that page; ISAPI Rewrite

Upvotes: 1

Afshin
Afshin

Reputation: 1253

implementing the IHttpModule you can do this, I've done the similar (not exactly) by following this guide:

http://www.stardeveloper.com/articles/http-module-to-redirect-requests-from-root-domain-to-www-subdomain/

and using this page you can find the source country of the request

another solution in this page

Upvotes: 2

Related Questions