We currently have all the bindings set in IIS to map to the Targer URL. We have HTTPS. For Target URL we are having a valid certificate. All the rest of the options therefore show as "This Connection is Untrusted" and therefore the user has to manually click
on proceed to website. We want to redirect the user to the desired site even if the user types any of the URL's. I mean the User's URL in the browser should change to the target URL and the secured connection should open.
I have found URL Redirect 2.0 after googling for this. Will this solve my problem. Is it safe or is there any gotcha's involved in this.
Hi Jeff, Thanx for the reply. I think I have referenced your URL in fab's post.
However, I did consider URL rewrite 2.0, but put it on hold as of now for the reason stated in fab's reply.
My apologies for I have missed a couple of details in my original post in hurry.
I am going to try that next.
I installed default URL rewrite server role and redirected all the URL's to the target URL. When I tried accessing it, I guess it was falling in a loop and the Website did not open. The moment I do an iisreset, the website comes up with the Target URL.
I am of the belief that this URL Rewrite 2.0 will help me when I use RegEx to identify the three other URL's only and redirect it to the Target URL.
Based on your description, Jeff's rule should work for you without causing any redirection loop. Could you please provide what's the request you used that causing the loop and what's the exact rule you are using?
Hi All, Thanks for the support. It looks like this has solved my issue. I have used the following in the actions instead of the above. In my case, required configuration is already in place to convert all HTTP requests to HTTPS. So, the HTTP and HTTPS does
not create any problem to me.
arun.passion...
10 Posts
How to URL Redirect "www.example1.com" & "www.example2.com" & "example2.com" to "example1.com" in...
Feb 29, 2012 03:06 PM|LINK
Hi All,
We are facing problems in URL Redirecting 4 URL's to a single URL.
The following is the mapping we need.
We are using IIS7 on WIn Srv 2008 SP1.
Edit Addition:
We currently have all the bindings set in IIS to map to the Targer URL. We have HTTPS. For Target URL we are having a valid certificate. All the rest of the options therefore show as "This Connection is Untrusted" and therefore the user has to manually click on proceed to website. We want to redirect the user to the desired site even if the user types any of the URL's. I mean the User's URL in the browser should change to the target URL and the secured connection should open.
I have found URL Redirect 2.0 after googling for this. Will this solve my problem. Is it safe or is there any gotcha's involved in this.
Any better option without installing any.
TIA
Arun Kumar Allu.
IIS7
owjeff
680 Posts
Re: How to URL Redirect "www.example1.com" & "www.example2.com" & "example2.com" to "example1.com...
Feb 29, 2012 03:47 PM|LINK
IIS URL Rewrite can help you do this:
http://learn.iis.net/page.aspx/460/using-the-url-rewrite-module/
You actually only need a rule for the bottom 3 cases. Something like this:
<rule name="Redirect example1" stopProcessing="true">
<match url=".*" />
<conditions logicalGrouping="MatchAny">
<add input="{HTTP_HOST}" pattern="^(www.)?example2.com" />
<add input="{HTTP_HOST}" pattern="www.example1.com" />
</conditions>
<action type="Redirect" url="http://example1.com/{R:0}" />
</rule>
OrcsWeb: Managed Windows Hosting Solutions
"Remarkable Service. Remarkable Support."
fab777
924 Posts
Re: How to URL Redirect "www.example1.com" & "www.example2.com" & "example2.com" to "example1.com...
Feb 29, 2012 03:52 PM|LINK
Hi,
did you have a look to the documentation?
> http://www.iis.net/ConfigReference/system.webServer/httpRedirect
Please 'Mark as Answer' if this post helps you.
Fabrice ZERROUKI
arun.passion...
10 Posts
Re: How to URL Redirect "www.example1.com" & "www.example2.com" & "example2.com" to "example1.com...
Feb 29, 2012 05:14 PM|LINK
Yes Fab, I have checked the post but kept it on hold as it required an additional installation. I need to check with my seniors before going ahead.
I also checked this post @ http://www.jppinto.com/2010/03/automatically-redirect-http-requests-to-https-on-iis7-using-url-rewrite-2-0/
I am not much into IIS and therefore was not sure if this solves the problem. Is there any gotchas with installing the URL Rewrite 2.0.
I have edited my question with my current scenario and the main problem which I missed in my earlier post.
Thanx.
arun.passion...
10 Posts
Re: How to URL Redirect "www.example1.com" & "www.example2.com" & "example2.com" to "example1.com...
Feb 29, 2012 05:27 PM|LINK
Hi Jeff, Thanx for the reply. I think I have referenced your URL in fab's post.
However, I did consider URL rewrite 2.0, but put it on hold as of now for the reason stated in fab's reply.
My apologies for I have missed a couple of details in my original post in hurry.
I am going to try that next.
I installed default URL rewrite server role and redirected all the URL's to the target URL. When I tried accessing it, I guess it was falling in a loop and the Website did not open. The moment I do an iisreset, the website comes up with the Target URL.
I am of the belief that this URL Rewrite 2.0 will help me when I use RegEx to identify the three other URL's only and redirect it to the Target URL.
Let me know if I am going in the wrong direction.
Lloydz
2335 Posts
Microsoft
Re: How to URL Redirect "www.example1.com" & "www.example2.com" & "example2.com" to "example1.com...
Mar 02, 2012 05:31 AM|LINK
Hi,
Based on your description, Jeff's rule should work for you without causing any redirection loop. Could you please provide what's the request you used that causing the loop and what's the exact rule you are using?
Thanks.
arun.passion...
10 Posts
Re: How to URL Redirect "www.example1.com" & "www.example2.com" & "example2.com" to "example1.com...
Mar 02, 2012 01:29 PM|LINK
Hi All,
Thanx for the support. I have tried with the following. (My contents of web.config)
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<defaultDocument>
<files>
<clear />
<add value="index.html" />
<add value="maintenance.htm" />
<add value="index.htm" />
<add value="Default.htm" />
<add value="Default.asp" />
<add value="iisstart.htm" />
<add value="default.aspx" />
</files>
</defaultDocument>
<httpRedirect enabled="false" destination="" exactDestination="false" />
<rewrite>
<rules>
<rule name="CanonicalHostNameRule1" stopProcessing="true">
<match url="(.*)" />
<conditions>
<add input="{HTTP_HOST}" pattern="^example1\.com$" negate="true" />
</conditions>
<action type="Redirect" url="http://example1.com/{R:1}" redirectType="Permanent" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>
This works with me as now redirecting the URL's to the destined URL.
The issue we are facing is that the website works for about 3-4 hours with no probs. After that the sub link with in the website does not open.
This is my sublink and "https://example1.com/MySubSite/Login/Login.aspx" this does not open.
Have I made any thing wrong.
TIA.
kctt
654 Posts
Re: How to URL Redirect "www.example1.com" & "www.example2.com" & "example2.com" to "example1.com...
Mar 06, 2012 04:29 AM|LINK
Your sublink is https while your redirect rule is http.
arun.passion...
10 Posts
Re: How to URL Redirect "www.example1.com" & "www.example2.com" & "example2.com" to "example1.com...
Mar 17, 2012 06:43 AM|LINK