Reputation: 2386
I wonder how to do specific redirection based on the scenario below?
When people open this url at browser http://www.test.com/gotogoogle
it will redirect them to http://www.google.com
.
Upvotes: 0
Views: 234
Reputation: 165208
You can achieve this with URL Rewrite module. The rule will be (content of web.config from website root folder):
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="Go To Google" stopProcessing="true">
<match url="^gotogoogle$" />
<action type="Redirect" url="http://www.google.com/" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>
If you already have web,config, then add appropriate fragment only.
Upvotes: 0
Reputation: 21979
You could use a RewriteMap in the IIS7 URL Rewrite module to achieve this..
http://learn.iis.net/page.aspx/469/using-rewrite-maps-in-url-rewrite-module/
Upvotes: 1