Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Redirect rewrite back to same address

Posted on 2016-10-26
3
Medium Priority
?
93 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:Charles Baldo
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 53

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 28

Accepted Solution

by:
Dan McFadden earned 2000 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:Charles Baldo
ID: 41862175
Thank you
0

Featured Post

Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

Question has a verified solution.

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

With the rising number of cyber attacks in recent years, keeping your personal data safe has become more important than ever. The tips outlined in this article will help you keep your identitfy safe.
In this article, WatchGuard's Director of Security Strategy and Research Teri Radichel, takes a look at insider threats, the risk they can pose to your organization, and the best ways to defend against them.
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

721 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