Click here to Skip to main content
15,890,882 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,
i've looked for a half an hour (not the best search utility on this forum) and i can't find the simple example of redirecting of specific url to other url
such as http://localhost/PHS/Attachments/[^]
to a login.aspx folder

How can i complete this task in iis server ???
thanx in advance
Posted
Comments
Thanks7872 15-Jul-13 7:20am    
What do you mean by redirecting of specific url to other url?
sajid zafar_Iqbal 15-Jul-13 9:06am    
if a request contains the path of my attachments folder then it will redirects to a page example abc.aspx ???
Zoltán Zörgő 15-Jul-13 7:30am    
Are you sure, you want to redirect to login page all the time?
sajid zafar_Iqbal 15-Jul-13 9:03am    
yes but in the way when requested url contains the path of my attachments folder.
then in the case redirects to login

 
Share this answer
 
v3
Comments
sajid zafar_Iqbal 15-Jul-13 9:01am    
I have reviewed it already but the problem is that it will redirects all the url to destination url all requests will automatically redirects to destination url.
how to deal with a single request or to redirect a single request to a apecific url not for all requets ...
Joezer BH 15-Jul-13 9:14am    
Why do you want to edit the IIS if you only want to handle a single request?
Please explain some more...

* Handling a single request can be easily done on the application level.
sajid zafar_Iqbal 15-Jul-13 9:21am    
if my url contains the folder named attachments like (http://localhost/PHSSeC/Attachments/abc.aspx)
then it must be redirects to any other page (such as login, home etc)
but not opens a that request http://localhost/PHS/Attachments/
Joezer BH 15-Jul-13 9:31am    
Updated solution above
Good luck,
Edo
As you mentioned login.aspx that draw me to the assumption, that you want to implement form based authentication. You don't need IIS level redirecting to do that, since IIS has support for this in conjunction with asp.net.
Take a look here:
http://msdn.microsoft.com/en-us/library/ff647070.aspx[^]
http://support.microsoft.com/kb/301240[^]
 
Share this answer
 
Comments
sajid zafar_Iqbal 15-Jul-13 8:59am    
thanx for reviewing and answering my question is that if any one types in url the path of my folder attachments then it will automatically redirects to some page not specific login page.
i have implemented in global.asax in pplication_AcquireRequestState event but it didn't works.
Zoltán Zörgő 15-Jul-13 11:12am    
Ok, but you want to redirect unconditionally? If so, why don't you simply put that folder out of IIS scope, or deny http access totally on that folder? If you want to allow only authenticated users to get access than it is a neat authentication-authorization kind of task.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900