Groups > Asp .Net > HttpHandlers and HttpModules > Re: Redirection Problem in Vista ie




Redirection Problem in Vista ie

Redirection Problem in Vista ie
Tue, 19 Feb 2008 09:18:34 +000
Hi,
    I have created a web application, and i need the total web site to be in
https. So i have written the below code in the PageInit of the  Master Page to
automatically redirect the site from http to https (http://myserver.com to
https://www.myserver.com ).

1    public void Page_Init(Object O, EventArgs e)
2    	{
3    if(this.Request.Url.Scheme.Equals(Uri.UriSchemeHttps))
4    		{
5    if(this.Request.Url.Authority.ToString().ToLower() !=
"www.myserver.com")
6    			{
7    				Response.Redirect(Uri.UriSchemeHttps + Uri.SchemeDelimiter
+"www."+ this.Request.Url.Authority + this.Request.Url.PathAndQuery);
8    			}
9    		}
10   else11   		{
12   if(this.Request.Url.Authority.ToString().ToLower() !=
"www.myserver.com")
13   			{
14   				Response.Redirect(Uri.UriSchemeHttps + Uri.SchemeDelimiter
+"www."+ this.Request.Url.Authority + this.Request.Url.PathAndQuery);
15   			}
16   else17   			{
18   				Response.Redirect(Uri.UriSchemeHttps + Uri.SchemeDelimiter +
this.Request.Url.Authority + this.Request.Url.PathAndQuery);
19   			}
20           }
21   	}
 

    This code works fine with IE6 and IE7. but when i tried to work with Vista
IE7 am not able to view the page.. Am getting the below security error message 

There is a problem with this website's security certificate.


 

  
This organization's certificate has been revoked.


 Security certificate problems may indicate an attempt to fool you or intercept
any data you send to the server. 


 

But when i removed the above coding from the master page, it works fine with
vista IE7 also, but this will not solve problem as i need to run my entire
website in https. So anybody please help me how do i solve this problem in
Window Vista IExplorer.  

 

Regards

KMS
Post Reply
Re: Redirection Problem in Vista ie
Tue, 19 Feb 2008 19:06:02 +000
While that may not be the most efficient redirect method, it looks like it
should work.  The important thing for the security cert is that the URL you go
to exactly matches the name in the cert.  So if your cert is issued to
https://www.myserver.com, you need to be sure that you redirect to the same URL.
 If your cert is issued to https://myserver.com, then you cannot redirect to
https://www.myserver.com without accepting the invalid certificate at the client
level.

I do my site redirect through IIS.  Setup a website in IIS for your unsecure
site and list the www dns entry for your domain at its IP address.  This site is
then configured with its Home Directory set to "A redirection to a
URL" which is your secure site.
Example:
Unsecure Site = www.mydomain.com = 123.123.123.101:80

Then the secure site is setup in IIS at a different subdomain name and IP
address.  This way the user can get to the site via the standard www notation
without any overhead within your secure site.  This also makes it a cinch to
modify the redirect during site maintenance or conversion.
Example:
Secure Site = secure.mydomain.com = 123.123.123.102:443

This setup also gets around any certificate problems in that the secure site is
named the same as the certificate.  The unsecure site has a different name and
no certifiacte set within IIS.  Take a look at the name your cert is
"Issued To:" and make sure it matches the name of your secure site. 
Then consider creating 2 sites in IIS as described above if it fits your needs.

Hope that helps!
Post Reply
Re: Redirection Problem in Vista ie
Wed, 20 Feb 2008 06:14:53 +000
Hi rkimble 

Thanks for your Information.. but my problem is not with the redirection to ssl.
iam able to redirect to SSL with the above coding. The only thing is am not able
to display my site is with Window Vista IE7,

 Pls Pls try to help me out of this...
Post Reply
Re: Redirection Problem in Vista ie
Mon, 25 Feb 2008 13:01:49 +000
Hi ShuAzi,

The Response.Redirect method is used to redirect a client to the new location
for a resource. The method performs a client-side redirect in which the browser
requests the new resource.

It appears you need to use Server.Transfer, ASP.NET does not verify that the
current user is authorized to view the resource delivered by the Transfer
method.
Post Reply
about | contact