Monday, February 22, 2010

Redirecting an HTTP Request to HTTPS

Navigating between the public and restricted areas of your site (that is, between HTTP and HTTPS pages) is an issue because a redirect always uses the protocol (HTTPS or HTTP) of the current page, not the target page.

After a user logs on and browses pages in a directory that is secured with SSL, relative links such as "..\publicpage.aspx" or redirects to HTTP pages result in the pages being served using the HTTPS protocol, which incurs an unnecessary performance overhead. To avoid this, use absolute links such as "http://servername/appname/publicpage.aspx" when redirecting from an HTTPS page to an HTTP page.

Similarly, when you redirect to a secure page (for example, the logon page) from a public area of your site, you must use an absolute HTTPS path, such as "https://servername/appname/secure/login.aspx" instead of a relative path, such as "restricted/login.aspx." For example, if your Web page provides a logon button, use the following code to redirect to the secure login page.

Copy Code
private void btnLogon_Click( object sender, System.EventArgs e )
{
// Form an absolute path using the server name and v-dir name
string serverName =
HttpUtility.UrlEncode(Request.ServerVariables["SERVER_NAME"]);
string vdirName = Request.ApplicationPath;
Response.Redirect("https://" + serverName + vdirName +
"/Restricted/Login.aspx");

}

Sunday, February 21, 2010

Usb flash drive icon changes into folder icon

This issue may have resulted from a virus infection on the machine the drive was plugged into.

You’ll need to delete the file autoruns.inf located on your flash drive.

By default, Windows hides this file, so before you can delete it you must make a couple of changes (you may reverse these after you’ve finished):

Open My Computer
Tools
Folder Options…
Click on the View tab
Under “Hidden files and folder” choose “Show hidden files and folders”
Remove the tick from “Hide protected operating system files (Recommended)
OK

Go back to My Computer and click on your flash drive. If you can’t open it that way, try right clicking on it and choose “Explore.”

Find the autoruns.inf file, right click on it and choose “Delete.” Confirm “Yes.”

Unplug and re-plug the drive in. You should be back to normal.


Hope that helps.