Subdomain Rewrite

Topics: User Forum
Oct 2, 2009 at 5:31 PM
Edited Oct 2, 2009 at 5:45 PM

Cheeso,

Per your request, I've started a new thread. I posted in the previous thread as it appeared related.

Your example is working to the extent that the application is no longer broken, but, the browser address bar now shows:

http://subdomain.domain.com/application/filename.aspx?url=parameter instead of http://subdomain.domain.com/filename.aspx?url=parameter (notice that the /application/ is now gone).

The application root on the server is: http://www.domain.com/application/ (this is the rewrite)

I want the browser address bar to show http://subdomain.domain.com/

Following the trailing slash in both instances is the filename plus any parameters necessary to process the request.

Here is the code you provided earlier:

RewriteCond  %{HTTP_HOST}  ^subdomain\.domain\.com$  [I]
RewriteRule ^/(?!application)(.*)$ /application/$1 [L]

Can you explain a little as to what the RewriteRule does. Maybe I can tweak it from there unless you know what the issue is based on my description above.

Thanks again Cheeso.

Gregory

 

 

<input id="ctl00_ctl00_MasterContent_Content_PostRepeater_ctl12_PostId" name="ctl00$ctl00$MasterContent$Content$PostRepeater$ctl12$PostId" type="hidden" value="241395" />

Normally what people do is open a new thread for a new problem.  It allows for better searching.

> HOWEVER, sometimes the http://subdomain.domain.com was getting appended to http://subdomain.domain.com/application/.

It sounds to me that you were using a bad regex.

Do you have a log file that shows this behavior?

move this to a new thread, will you?

Coordinator
Oct 2, 2009 at 5:49 PM

Gregory,

This rule:

RewriteRule  ^/(?!application)(.*)$       /application/$1 [L]

will not change the browser address bar.  It is a server side rewrite.  If the browser address bar is changed, then something else is doing it.

Check the IIRF Log to verify this.

 

Oct 2, 2009 at 5:56 PM

Cheeso,

Here a log snippet:

Fri Oct 02 10:51:39 -  7632 - EvalCondition: checking 'subdomain.domain.com' against pattern '^subdomain\.domain\.com$'
Fri Oct 02 10:51:39 -  7632 - EvalCondition: match result: 1 (match)
Fri Oct 02 10:51:39 -  7632 - EvalCondition: returning TRUE
Fri Oct 02 10:51:39 -  7632 - EvalConditionList: rule 9, TRUE, Rule will apply
Fri Oct 02 10:51:39 -  7632 - ApplyCaseConversion: after  '/survey/Login.aspx'
Fri Oct 02 10:51:39 -  7632 - EvaluateRules: Result (length 18): /survey/Login.aspx
Fri Oct 02 10:51:39 -  7632 - EvaluateRules: Last Rule
Fri Oct 02 10:51:39 -  7632 - EvaluateRules: returning 1
Fri Oct 02 10:51:39 -  7632 - DoRewrites: Rewrite Url to: '/survey/Login.aspx'
Fri Oct 02 10:51:39 -  7632 - HttpFilterProc: SF_NOTIFY_URL_MAP
Fri Oct 02 10:51:39 -  9136 - HttpFilterProc: SF_NOTIFY_URL_MAP
Fri Oct 02 10:51:39 -  7984 - HttpFilterProc: SF_NOTIFY_URL_MAP
Fri Oct 02 10:51:39 -  7984 - HttpFilterProc: SF_NOTIFY_URL_MAP
Fri Oct 02 10:51:39 -  7632 - HttpFilterProc: SF_NOTIFY_URL_MAP
Fri Oct 02 10:51:39 -  7632 - HttpFilterProc: SF_NOTIFY_AUTH_COMPLETE

Still not sure why the browser address bar shows the "/survey/" folder, which is the application.

Gregory

Coordinator
Oct 2, 2009 at 6:05 PM
Edited Oct 2, 2009 at 6:07 PM

Couple things.

  1. I don't see the incoming request.  I suppose it is "Login.aspx" but it's hard to get the picture if I have to guess.
  2. I don't see a 301 or 302 response being generated by IIRF, which would lead to a change in the browser address bar.   This doesn't mean it isn't happening, but it isn't happening in this section of the IIRF logfile. 
  3. You have 5 invocations of NOTIFY_URL_MAP.  This is unexpected.  Why is it happening?  Have you registered the filter multiple times?  have you registered it for the site as well as for the server?  Do you have other filters installed?

The next thing I can suggest is tracing the HTTP transactions with a tool  like Fiddler2.   With that you should be able to see HTTP requests and responses out of and into your browser.  There may be a 301 or 302 there, a REDIRECT, which would explain the change in the browser address bar.  But it won't pinpoint the source.

What could the source be?  IIRF can do redirects, but not with the rule you are using.  If there are other rules in the ini file, then it's possible one of the other IIRF rules is doing the redirect, and you haven't shown me the log for it.  If there is another filter installed, it could be *that* causing the redirect.  It's also possible to configure a redirect in the IIS config metabase via IIS Manager, with no 3rd party filter.  It's also possible to do a redirect within an .aspx page or similar.   So there could be many causes.  You just have to track it down by looking through the logs, including Fiddler, IIRF, and maybe IIS logs.  (often found at c:\inetpub\logs\LogFiles\W3SVC1 ) 

 

 

 

Oct 2, 2009 at 6:22 PM
Hi Cheeso,

Okay. I'll download and try Fiddler2. In the meantime, here is the
complete log file for that request time. I'm also attaching my
complete INI.

To answer a few of your questions first:

1. We are on a premium shared server. The DLL was installed by the
host in our directory by the hosting provider. What do I need to
submit/say to them regarding the multiple instances of NOTIFY_URL_MAP?

2. The only thing we configured in IIS is the Application/Virtual
Directory for the ASP.NET Application with the following settings:
- Directory Path: D:\FTP\gox\Htdocs\survey
- Application: yes
- Virtual Directory: no
- Virtual Directory Name: /survey

Could that be doing it, i.e., the Virtual Directory Name?

3. No redirects are set in the Application pages.

Okay, here is both the complete log file for this request in addition to my INI:

LOG
Fri Oct 02 10:51:39 - 7632 - HttpFilterProc: SF_NOTIFY_URL_MAP
Fri Oct 02 10:51:39 - 7632 - HttpFilterProc: SF_NOTIFY_AUTH_COMPLETE
Fri Oct 02 10:51:39 - 7632 - DoRewrites
Fri Oct 02 10:51:39 - 7632 - DoRewrites: New Url: '/Login.aspx'
Fri Oct 02 10:51:39 - 7632 - EvaluateRules: depth=0
Fri Oct 02 10:51:39 - 7632 - EvaluateRules: Rule 1 : 2 matches
Fri Oct 02 10:51:39 - 7632 - EvalCondition: ts1 'survey.domain.com'
Fri Oct 02 10:51:39 - 7632 - ApplyCaseConversion: after 'survey.domain.com'
Fri Oct 02 10:51:39 - 7632 - EvalCondition: checking
'survey.domain.com' against pattern '^domain\.com$'
Fri Oct 02 10:51:39 - 7632 - EvalCondition: match result: -1 (No match)
Fri Oct 02 10:51:39 - 7632 - EvalCondition: returning FALSE
Fri Oct 02 10:51:39 - 7632 - EvalConditionList: rule 1, FALSE, Rule
does not apply
Fri Oct 02 10:51:39 - 7632 - EvaluateRules: Rule 2 : -1 (No match)
Fri Oct 02 10:51:39 - 7632 - EvaluateRules: Rule 3 : 2 matches
Fri Oct 02 10:51:39 - 7632 - EvalCondition: ts1 '/Login.aspx'
Fri Oct 02 10:51:39 - 7632 - ApplyCaseConversion: after '/Login.aspx'
Fri Oct 02 10:51:39 - 7632 - EvalCondition: checking '/Login.aspx'
against pattern '^/forum/$'
Fri Oct 02 10:51:39 - 7632 - EvalCondition: match result: -1 (No match)
Fri Oct 02 10:51:39 - 7632 - EvalCondition: returning FALSE
Fri Oct 02 10:51:39 - 7632 - EvalConditionList: rule 3, FALSE, Rule
does not apply
Fri Oct 02 10:51:39 - 7632 - EvaluateRules: Rule 4 : 2 matches
Fri Oct 02 10:51:39 - 7632 - EvalCondition: ts1 '/Login.aspx'
Fri Oct 02 10:51:39 - 7632 - ApplyCaseConversion: after '/Login.aspx'
Fri Oct 02 10:51:39 - 7632 - EvalCondition: checking '/Login.aspx'
against pattern '^/public/$'
Fri Oct 02 10:51:39 - 7632 - EvalCondition: match result: -1 (No match)
Fri Oct 02 10:51:39 - 7632 - EvalCondition: returning FALSE
Fri Oct 02 10:51:39 - 7632 - EvalConditionList: rule 4, FALSE, Rule
does not apply
Fri Oct 02 10:51:39 - 7632 - EvaluateRules: Rule 5 : 2 matches
Fri Oct 02 10:51:39 - 7632 - EvalCondition: ts1 '/Login.aspx'
Fri Oct 02 10:51:39 - 7632 - ApplyCaseConversion: after '/Login.aspx'
Fri Oct 02 10:51:39 - 7632 - EvalCondition: checking '/Login.aspx'
against pattern '^/members/$'
Fri Oct 02 10:51:39 - 7632 - EvalCondition: match result: -1 (No match)
Fri Oct 02 10:51:39 - 7632 - EvalCondition: returning FALSE
Fri Oct 02 10:51:39 - 7632 - EvalConditionList: rule 5, FALSE, Rule
does not apply
Fri Oct 02 10:51:39 - 7632 - EvaluateRules: Rule 6 : -1 (No match)
Fri Oct 02 10:51:39 - 7632 - EvaluateRules: Rule 7 : 2 matches
Fri Oct 02 10:51:39 - 7632 - EvalCondition: ts1 '/Login.aspx'
Fri Oct 02 10:51:39 - 7632 - ApplyCaseConversion: after '/Login.aspx'
Fri Oct 02 10:51:39 - 7632 - EvalCondition: checking '/Login.aspx'
against pattern '^/public/5\.cfm$'
Fri Oct 02 10:51:39 - 7632 - EvalCondition: match result: -1 (No match)
Fri Oct 02 10:51:39 - 7632 - EvalCondition: returning FALSE
Fri Oct 02 10:51:39 - 7632 - EvalConditionList: rule 7, FALSE, Rule
does not apply
Fri Oct 02 10:51:39 - 7632 - EvaluateRules: Rule 8 : 2 matches
Fri Oct 02 10:51:39 - 7632 - EvalCondition: ts1 '/Login.aspx'
Fri Oct 02 10:51:39 - 7632 - ApplyCaseConversion: after '/Login.aspx'
Fri Oct 02 10:51:39 - 7632 - EvalCondition: checking '/Login.aspx'
against pattern '^/public/33\.cfm$'
Fri Oct 02 10:51:39 - 7632 - EvalCondition: match result: -1 (No match)
Fri Oct 02 10:51:39 - 7632 - EvalCondition: returning FALSE
Fri Oct 02 10:51:39 - 7632 - EvalConditionList: rule 8, FALSE, Rule
does not apply
Fri Oct 02 10:51:39 - 7632 - EvaluateRules: Rule 9 : 2 matches
Fri Oct 02 10:51:39 - 7632 - EvalCondition: ts1 'survey.domain.com'
Fri Oct 02 10:51:39 - 7632 - ApplyCaseConversion: after 'survey.domain.com'
Fri Oct 02 10:51:39 - 7632 - EvalCondition: checking
'survey.domain.com' against pattern '^survey\.domain\.com$'
Fri Oct 02 10:51:39 - 7632 - EvalCondition: match result: 1 (match)
Fri Oct 02 10:51:39 - 7632 - EvalCondition: returning TRUE
Fri Oct 02 10:51:39 - 7632 - EvalConditionList: rule 9, TRUE, Rule will apply
Fri Oct 02 10:51:39 - 7632 - ApplyCaseConversion: after '/survey/Login.aspx'
Fri Oct 02 10:51:39 - 7632 - EvaluateRules: Result (length 18):
/survey/Login.aspx
Fri Oct 02 10:51:39 - 7632 - EvaluateRules: Last Rule
Fri Oct 02 10:51:39 - 7632 - EvaluateRules: returning 1
Fri Oct 02 10:51:39 - 7632 - DoRewrites: Rewrite Url to: '/survey/Login.aspx'
Fri Oct 02 10:51:39 - 7632 - HttpFilterProc: SF_NOTIFY_URL_MAP
Fri Oct 02 10:51:39 - 9136 - HttpFilterProc: SF_NOTIFY_URL_MAP
Fri Oct 02 10:51:39 - 7984 - HttpFilterProc: SF_NOTIFY_URL_MAP
Fri Oct 02 10:51:39 - 7984 - HttpFilterProc: SF_NOTIFY_URL_MAP
Fri Oct 02 10:51:39 - 7632 - HttpFilterProc: SF_NOTIFY_URL_MAP
Fri Oct 02 10:51:39 - 7632 - HttpFilterProc: SF_NOTIFY_AUTH_COMPLETE
Fri Oct 02 10:51:39 - 7632 - DoRewrites
Fri Oct 02 10:51:39 - 7632 - DoRewrites: New Url: '/survey/SurveyList.aspx'
Fri Oct 02 10:51:39 - 7632 - EvaluateRules: depth=0
Fri Oct 02 10:51:39 - 7632 - EvaluateRules: Rule 1 : 2 matches
Fri Oct 02 10:51:39 - 7632 - EvalCondition: ts1 'survey.domain.com'
Fri Oct 02 10:51:39 - 7632 - ApplyCaseConversion: after 'survey.domain.com'
Fri Oct 02 10:51:39 - 7632 - EvalCondition: checking
'survey.domain.com' against pattern '^domain\.com$'
Fri Oct 02 10:51:39 - 7632 - EvalCondition: match result: -1 (No match)
Fri Oct 02 10:51:39 - 7632 - EvalCondition: returning FALSE
Fri Oct 02 10:51:39 - 7632 - EvalConditionList: rule 1, FALSE, Rule
does not apply
Fri Oct 02 10:51:39 - 7632 - EvaluateRules: Rule 2 : -1 (No match)
Fri Oct 02 10:51:39 - 7632 - EvaluateRules: Rule 3 : 2 matches
Fri Oct 02 10:51:39 - 7632 - EvalCondition: ts1 '/survey/SurveyList.aspx'
Fri Oct 02 10:51:39 - 7632 - ApplyCaseConversion: after
'/survey/SurveyList.aspx'
Fri Oct 02 10:51:39 - 7632 - EvalCondition: checking
'/survey/SurveyList.aspx' against pattern '^/forum/$'
Fri Oct 02 10:51:39 - 7632 - EvalCondition: match result: -1 (No match)
Fri Oct 02 10:51:39 - 7632 - EvalCondition: returning FALSE
Fri Oct 02 10:51:39 - 7632 - EvalConditionList: rule 3, FALSE, Rule
does not apply
Fri Oct 02 10:51:39 - 7632 - EvaluateRules: Rule 4 : 2 matches
Fri Oct 02 10:51:39 - 7632 - EvalCondition: ts1 '/survey/SurveyList.aspx'
Fri Oct 02 10:51:39 - 7632 - ApplyCaseConversion: after
'/survey/SurveyList.aspx'
Fri Oct 02 10:51:39 - 7632 - EvalCondition: checking
'/survey/SurveyList.aspx' against pattern '^/public/$'
Fri Oct 02 10:51:39 - 7632 - EvalCondition: match result: -1 (No match)
Fri Oct 02 10:51:39 - 7632 - EvalCondition: returning FALSE
Fri Oct 02 10:51:39 - 7632 - EvalConditionList: rule 4, FALSE, Rule
does not apply
Fri Oct 02 10:51:39 - 7632 - EvaluateRules: Rule 5 : 2 matches
Fri Oct 02 10:51:39 - 7632 - EvalCondition: ts1 '/survey/SurveyList.aspx'
Fri Oct 02 10:51:39 - 7632 - ApplyCaseConversion: after
'/survey/SurveyList.aspx'
Fri Oct 02 10:51:39 - 7632 - EvalCondition: checking
'/survey/SurveyList.aspx' against pattern '^/members/$'
Fri Oct 02 10:51:39 - 7632 - EvalCondition: match result: -1 (No match)
Fri Oct 02 10:51:39 - 7632 - EvalCondition: returning FALSE
Fri Oct 02 10:51:39 - 7632 - EvalConditionList: rule 5, FALSE, Rule
does not apply
Fri Oct 02 10:51:39 - 7632 - EvaluateRules: Rule 6 : -1 (No match)
Fri Oct 02 10:51:39 - 7632 - EvaluateRules: Rule 7 : 2 matches
Fri Oct 02 10:51:39 - 7632 - EvalCondition: ts1 '/survey/SurveyList.aspx'
Fri Oct 02 10:51:39 - 7632 - ApplyCaseConversion: after
'/survey/SurveyList.aspx'
Fri Oct 02 10:51:39 - 7632 - EvalCondition: checking
'/survey/SurveyList.aspx' against pattern '^/public/5\.cfm$'
Fri Oct 02 10:51:39 - 7632 - EvalCondition: match result: -1 (No match)
Fri Oct 02 10:51:39 - 7632 - EvalCondition: returning FALSE
Fri Oct 02 10:51:39 - 7632 - EvalConditionList: rule 7, FALSE, Rule
does not apply
Fri Oct 02 10:51:39 - 7632 - EvaluateRules: Rule 8 : 2 matches
Fri Oct 02 10:51:39 - 7632 - EvalCondition: ts1 '/survey/SurveyList.aspx'
Fri Oct 02 10:51:39 - 7632 - ApplyCaseConversion: after
'/survey/SurveyList.aspx'
Fri Oct 02 10:51:39 - 7632 - EvalCondition: checking
'/survey/SurveyList.aspx' against pattern '^/public/33\.cfm$'
Fri Oct 02 10:51:39 - 7632 - EvalCondition: match result: -1 (No match)
Fri Oct 02 10:51:39 - 7632 - EvalCondition: returning FALSE
Fri Oct 02 10:51:39 - 7632 - EvalConditionList: rule 8, FALSE, Rule
does not apply
Fri Oct 02 10:51:39 - 7632 - EvaluateRules: Rule 9 : -1 (No match)
Fri Oct 02 10:51:39 - 7632 - EvaluateRules: returning 0
Fri Oct 02 10:51:39 - 7632 - DoRewrites: No Rewrite
Fri Oct 02 10:51:39 - 7632 - HttpFilterProc: SF_NOTIFY_URL_MAP
Fri Oct 02 10:51:39 - 9036 - HttpFilterProc: SF_NOTIFY_URL_MAP
Fri Oct 02 10:51:39 - 9036 - HttpFilterProc: SF_NOTIFY_URL_MAP

INI
# IsapiRewrite4.ini
RewriteFilterPriority HIGH
RewriteLogLevel 3
RewriteLog D:\FTP\domain\ISAPI_Rewriter.Log\iirfLog.out
MaxMatchCount 10

# redirect all non-www traffic to www url
RewriteCond %{HTTP_HOST} ^domain\.com$ [I]
RedirectRule ^/(.*)$ http://www.domain.com/$1 [I,R=301]

# fix missing slash on folders
# note, this assumes we have no folders with periods!
RedirectRule ^/([^.?]+[^.?/])$ /$1/ [I,R=301]

# redirect all requests to /forum to the forum app
RewriteCond %{URL} ^/forum/$ [I]
RedirectRule ^(.*)$ http://forum.domain.com [I,R=301]

# redirect all requests to /public to the default document
RewriteCond %{URL} ^/public/$ [I]
RedirectRule ^(.*)$ http://www.domain.com/public/main.cfm [I,R=301]

# redirect all requests to /members to the default document
RewriteCond %{URL} ^/members/$ [I]
RedirectRule ^(.*)$ http://www.domain.com/members/main.cfm [I,R=301]

# only allow whitelisted referers to hotlink images
RewriteCond %{HTTP_REFERER} ^(?!HTTP_REFERER)
RewriteCond %{HTTP_REFERER} ^(?!http://www\.domain\.com) [I]
RewriteCond %{HTTP_REFERER} ^(?!https://www\.domain\.com) [I]
RewriteCond %{HTTP_REFERER} ^(?!http://www\.forum\.domain\.com) [I]
RewriteCond %{HTTP_REFERER} ^(?!http://forum\.domain\.com) [I]
RewriteCond %{HTTP_REFERER} ^(?!http://support\.domain\.com) [I]
RewriteCond %{HTTP_REFERER} ^(?!http://survey\.domain\.com) [I]
RewriteRule \.(?:gif|jpg|jpeg|png)$ /public/images/space.jpg [I,L]

# incoming URL request that is not using HTTPS,
# and is a the main sales page URL,
# will be redirected to the secure site.
RewriteCond %{URL} ^/public/5\.cfm$ [I]
RewriteCond %{HTTPS} ^off$
RedirectRule ^(.*)$ https://www.domain.com$1 [I,R=301]

# incoming URL request that is not using HTTPS,
# and is a the affiliate signup page URL,
# will be redirected to the secure site.
RewriteCond %{URL} ^/public/33\.cfm$ [I]
RewriteCond %{HTTPS} ^off$
RedirectRule ^(.*)$ https://www.domain.com$1 [I,R=301]

# REDIRECT to change the address in the browser address bar
#RewriteCond %{URL} ^/survey/$ [I]
#RedirectRule ^(.*)$ http://survey.domain.com [I,R=301]

RewriteCond %{HTTP_HOST} ^survey\.domain\.com$ [I]
RewriteRule ^/(?!survey)(.*)$ /survey/$1 [L]

Thanks for your help Cheeso.

Gregory

On Fri, Oct 2, 2009 at 11:05 AM, Cheeso <[email removed]> wrote:
> From: Cheeso
>
> Couple things.
>
> I don't see the incoming request.  I suppose it is "Login.aspx" but it's
> hard to get the picture if I have to guess.
> I don't see a 301 or 302 response, which would lead to a change in the
> browser address bar.
> You have 5 invocations of NOTIFY_URL_MAP.  This is unexpected.  Why is it
> happening?  Have you registered the filter multiple times?  have you
> registered it for the site as well as for the server?
>
> The next thing I can suggest is tracing the HTTP transactions with a tool
> like Fiddler2.   With that you should be able to see HTTP requests and
> responses out of and into your browser.  There may be a 301 or 302 there, a
> REDIRECT, which would explain the change in the browser address bar.  But it
> won't pinpoint the source.
>
> What could the source be?  IIRF can do redirects, but not with the rule you
> are using.  If there are other rules in the ini file, then it's possible one
> of the other rules is doing the redirect, and you havent shown me the log
> for it.   It's also possible to configure a redirect in the IIS config
> metabase via IIS Manager.  It's also possible to do a redirect within an
> .aspx page or similar.   So there could be many causes.  You just have to
> track it down by looking through the logs, including Fiddler, IIRF,
> and maybe IIS logs.  (often found at c:\inetpub\logs\LogFiles\W3SVC1 )
>
>
>
>
>
>
>
> Read the full discussion online.
>
> To add a post to this discussion, reply to this email
> ([email removed])
>
> To start a new discussion for this project, email
> [email removed]
>
> You are receiving this email because you subscribed to this discussion on
> CodePlex. You can unsubscribe on codePlex.com.
>
> Please note: Images and attachments will be removed from emails. Any posts
> to this discussion will also be available online at codeplex.com
Coordinator
Oct 2, 2009 at 6:53 PM
Edited Oct 2, 2009 at 6:57 PM

some answers

  1. after looking at your log, I don't think it is a multi-install problem.  I suspect they your hoster has other filters installed.  But it won't affect the operation of IIRF.  Also, the log has no surprises, and according to it, no 301 or 302 redirects are coming from IIRF.  
  2. No, the redirect does not seem to be coming from the virtual directory.
  3. hmm

I suspect the application is the culprit - the aspx pages themselves.  Often within the logic for an ASPNET page, you may find a reference to an an absolute URL path.  Eg /survey/SurveyList.aspx as opposed to just SurveryList.aspx. 

Another thing to consider - if you run on IIS6 or 7, as I'm sure the hoster does, there can be multiple worker processes for each website.  Not sure if this is how they have it set up for you or not.  If there are multiple worker proceses, then each process gets its own IIRF log.  There may be other w3wp.exe processes handling requests, and those requests would be filtered by IIRF, but they would not show up in just one log.  The logfile name has the process id within it. 

Separately - Which page is the first one that changes the browser address bar?  Is it Login.aspx itself?    Is it possible the Login page is checking something like If (Page.IsPostBack) and then forwarding the request if it is not a postback? 

You might consider simplifying the situation in order to understand it better.  Rewrite to a new page - a test page (test.aspx), which is very simple and does nothing.  Do you still get the surprise redirect?   Then add things back in, testing at each step.  You may be able to track it down that way.

The Fiddler tool is also invaluable when doing diagnostics like this.

 

Oct 2, 2009 at 7:01 PM
Hi Cheeso,

Yea, it looks like the moment we log into the application, a 302
redirect is being performed to /survey. It's not coming from IIS, nor
is it coming from my filter from what I can tell. There must be
something in the login.aspx file that is detecting where it lives and
sets up from there.

Thanks for your help. I'll adivse of my futher findings.

Gregory

On Fri, Oct 2, 2009 at 11:53 AM, Cheeso <notifications@codeplex.com> wrote:
> From: Cheeso
>
> some answers
>
> after looking at your log, I don't think it is a multi-install problem.  I
> suspect they have other filters installed.  But it won't affect the
> operation of IIRF.
> No, the redirect does not seem to be coming from the virtual directory.
> hmm
>
> I suspect the application is the culprit - the aspx pages themselves.  Often
> within the logic for an ASPNET page, you may find a reference to an an
> absolute URL path.  Eg /survey/SurveyList.aspx as opposed to just
> SurveryList.aspx.
>
> Which page is the first one that changes the browser address bar?  Is it
> Login.aspx itself?    Is it possible the Login page is checking something
> like If (Page.IsPostBack) and then forwarding the request if it is not a
> postback?
>
> You might consider simplifying the situation in order to understand it
> better.  Rewrite to a new page - a test page (test.aspx), which is very
> simple and does nothing.  Do you still get the surprise redirect?   Then add
> things back in, testing at each step.  You may be able to track it down that
> way.
>
> The Fiddler tool is also invaluable when doing diagnostics like this.
>
>
>
>
>
>
>
> Read the full discussion online.
>
> To add a post to this discussion, reply to this email
> ([email removed])
>
> To start a new discussion for this project, email
> [email removed]
>
> You are receiving this email because you subscribed to this discussion on
> CodePlex. You can unsubscribe on codePlex.com.
>
> Please note: Images and attachments will be removed from emails. Any posts
> to this discussion will also be available online at codeplex.com
Coordinator
Oct 2, 2009 at 7:11 PM

I think a redirect might happen in the Forms authentication module in ASPNET.

Should be easy to fix.  Just a config file change.  Instead of redirecting to /survey/Whatever.aspx, just redirect to Whatever.aspx.  The rewrite rules in the IIRF ini file will get you back to the Survey ASPX pages.   But you need to be careful to not "hide" any existing ASPX files this way. I guess that concern applies to any use of rewrite.

 

 

 

 

Oct 2, 2009 at 7:22 PM
Cheeso,

The developer stated that what happens on the Login.aspx is a .NET
response redirect which we assume sees that it lives in /survey and
redirects to that URL.

No actual path is hard coded into the .NET files. The only place these
types of things get defined is in the weg.config file of the
application which is currently set to survey.gox.com, i.e., <add
key="SUR_APPLICATION_ROOT_URL"
value="http://survey.domain.com"></add>

Can we address this in the IIRF filter?

Gregory



On Fri, Oct 2, 2009 at 12:11 PM, Cheeso <notifications@codeplex.com> wrote:
> From: Cheeso
>
> I think a redirect might happen in the Forms authentication module in
> ASPNET.
>
> Should be easy to fix.  Just a config file change.  Instead of redirecting
> to /survey/Whatever.aspx, just redirect to Whatever.aspx.  The rewrite rules
> in the IIRF ini file will get you back to the Survey ASPX pages.   But you
> need to be careful to not "hide" any existing ASPX files this way. I guess
> that concern applies to any use of rewrite.
>
>
>
>
>
>
>
>
>
> Read the full discussion online.
>
> To add a post to this discussion, reply to this email
> ([email removed])
>
> To start a new discussion for this project, email
> [email removed]
>
> You are receiving this email because you subscribed to this discussion on
> CodePlex. You can unsubscribe on codePlex.com.
>
> Please note: Images and attachments will be removed from emails. Any posts
> to this discussion will also be available online at codeplex.com
Coordinator
Oct 2, 2009 at 7:32 PM
Edited Oct 2, 2009 at 7:45 PM

There are two ways to go.

One is to redirect to the place you want.  For this you'd need to fix the config in the web.config file.  Instead of

<authentication mode="Forms">   
    <forms loginUrl="Login.aspx" defaultUrl="SurveyList.aspx" />
</authentication>

Can you try:

<authentication mode="Forms">   
    <forms loginUrl="Login.aspx" defaultUrl="/SurveyList.aspx" />
</authentication>

Notice the preceding slash. The idea is to try to force the redirect to a fully-qualified page, rather than one that uses the relative URL path.

That is idea #1. If you cannot change the ASPNET logic to redirect to where you want it to go, you can use IIRF to redirect for you. This requires a RedirectRule in the ini file. something like this:

RedirectRule ^/survey/(.+)\.aspx  /$1\.aspx  [L]

This works as a complement to the RewriteRule, not as a replacement. If a request comes in with /survey as the URL path prefix, then it is redirected to remove it. Then the redirected request comes in, for SurveyList.aspx, and it is rewritten (no browser address bar change) to the /survey/SurveyList.aspx.  If you take this approach it means another round-trip in HTTP transactions, and the user will see the address bar change briefly, twice. So it is not the most elegant, from the perspective of the user experience.

Better to redirect to the desired page, once.

Oct 2, 2009 at 7:43 PM
... thanks for all your help on this one Cheeso.

Gregory

On Fri, Oct 2, 2009 at 12:32 PM, Cheeso <notifications@codeplex.com> wrote:

From: Cheeso

There are two ways to go.

One is to redirect to the place you want.  For this you'd need to fix the config in the web.config file.  Instead of

<authentication mode="Forms">   
    <forms loginUrl="Login.aspx" defaultUrl="SurveyList.aspx" />
</authentication>

Can you try:

<authentication mode="Forms">   
    <forms loginUrl="Login.aspx" defaultUrl="/SurveyList.aspx" />
</authentication>

Notice the preceding slash. The idea is to try to force the redirect to a fully-qualified page, rather than one that uses the relative URL path.

That is idea #1. If you cannot change the ASPNET logic to redirect to where you want it to go, you can use IIRF to redirect for you. This requires a RedirectRule in the ini file. something like this:

RedirectRule ^/survey/(.+)\.aspx  /$1\.aspx  [L]

This works as a complement to the RewriteRule, not as a replacement. IF a request comes in with /survey as the URL path prefix, then it is redirected to remove it. Then if a request comes in for SurveyList.aspx, it is rewritten (no browser address bar change) to the /survey/SurveyList.aspx. IF you take this path it means another round-trip in HTTP transactions, and the user will see the address bar change briefly. So it is not the most elegant from the user experience perspective.

Better to redirect to the desired page, once.

Read the full discussion online.

To add a post to this discussion, reply to this email (IIRF@discussions.codeplex.com)

To start a new discussion for this project, email IIRF@discussions.codeplex.com

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe on codePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at codeplex.com