Solved

Redirect rewrite back to same address

Posted on 2016-10-26
3
58 Views
Last Modified: 2016-10-27
Hi,

I can not modify code on this problem must do  it in IIS. It is a Microsoft .net frameworks 4.0 website iis6

I have a website that I want a user to get into only from a specific refereed address

Let's ay it is http://www.contoso.com   

there is a page http://www.contoso.com/profile.aspx    I do not want the user going right to http://www.contoso.com/profile.aspx     but want them to go to http://www.contoso.com/default.aspx  .   in default.aspx it will set a security session variable then redirect back to http://www.contoso.com/profile.aspx

How can I do this strictly with IIS?  I can  not change the applications code.
0
Comment
Question by:charlesbaldo
3 Comments
 
LVL 49

Expert Comment

by:Ryan Chong
ID: 41861677
in your existing codes, is that profile.aspx  will be redirected to default.aspx if there is not session variable being stored?
0
 
LVL 26

Accepted Solution

by:
Dan McFadden earned 500 total points
ID: 41861794
This is not something that IIS can do.  In general, the AppPool that hosts the site/app, has no knowledge of any sessions that exist or not.  The AppPool do not have any configurable interface to talk to the application code to pull a session and check if it valid or not.

The only way I can think of this working is to use the "HTTP_Referer" field in the inbound HTTP request.  This is easily accomplished with the URL Rewrite feature that is available for IIS7+.

Here is an IIS.NET forum dicussion on the same issue.

Link:  https://forums.iis.net/t/1189057.aspx

But you have a technology challenge, namely IIS6.  There are builtin URL Rewrite options for IIS6.  You need to use either a 3rd party commercial ISAPI filter like something from Helicon (Apache compatible URL rewriting for IIS :  http://www.isapirewrite.com/) or an open source product like Ionics Isapi Rewrite Filter (http://iirf.codeplex.com/).

Dan
0
 

Author Closing Comment

by:charlesbaldo
ID: 41862175
Thank you
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Never store passwords in plain text or just their hash: it seems a no-brainier, but there are still plenty of people doing that. I present the why and how on this subject, offering my own real life solution that you can implement right away, bringin…
Most of the applications these days are on Cloud. Cloud is ubiquitous with many service providers in the market. Since it has many benefits such as cost reduction, software updates, remote access, disaster recovery and much more.
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

947 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now