Solved

Redirect rewrite back to same address

Posted on 2016-10-26
3
43 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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Phishing is at the top of most security top 10 efforts you should be pursuing in 2016 and beyond. If you don't have phishing incorporated into your Security Awareness Program yet, now is the time. Phishers, and the scams they use, are only going to …
Container Orchestration platforms empower organizations to scale their apps at an exceptional rate. This is the reason numerous innovation-driven companies are moving apps to an appropriated datacenter wide platform that empowers them to scale at a …
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…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

762 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

18 Experts available now in Live!

Get 1:1 Help Now