Asp.net use Fully Qualified RedirectUrl

Asp.net use Fully Qualified RedirectUrl Asp.net useFullyQualifiedRedirectUrl

In web.config, You may have come across the Boolean tag called useFullyQualifiedRedirectUrl. Here we will see what is the purpose of this tag.

Suppose that your website domain name is http://www.satalaj.com. and your default.aspx fully qualified URL name is http://www.satalaj.com/uploads/default.aspx.

On click event of button inside default.aspx page, you are redirecting the user to http://www.satalaj.com/download/handler.aspx. The code written on click looks like below one.

 Response.Redirect("~/handler.aspx");

What happens when browser get's response? Browser gets response status code as 302 and it search the redirected URL location inside the header of response. Without rendering the current page it sends request to page found inside response header.

If page contained in response header is "download/handler.aspx", it tries to resolve to fully qualified URL as http://www.satalaj.com/download/handler.aspx.

Some browsers, mobile devices are not capable of resolving URL to fully qualified URL. To overcome the issue of not getting redirected to new page. use tag in web.config as useFullyQualifiedRedirectUrl = true.

Difference between Status code 301 and 302.

When search engine crawler gets page response as 302 it understands that the resource is temporarily moved to new location. If the response status code is 301, it means that resource has been permanently moved to new location.

Tags:

ASP.net File HandlingAsp.net Interview Questions for 2 years or 3 years experianceasp net image uploadASp.net 2.0 step by step Membership Provider What is web garden in Asp.net?Asp.net Convert Image To Base64Asp.net Create Folder On ServerAsp.net open new windowHack asp.net[Asp.net] Get current Page URL absolute URI and query string parameters.Asp.net Convert String To Image

Author

My name is Satalaj, but people call me Sat. Here is my homepage: . I live in Pune, PN and work as a Software Engineer. I'm former MVP in ASP.net year 2010.
Disclaimer: Views or opinion expressed here are my personal research and it has nothing to do with my employer. You are free to use the code, ideas/hints in your projects. However, you should not copy and paste my original content to other web sites. Feel free to copy or extend the code.
If you want to fight with me, this website is not for you.
 

I'm Satalaj.