Solved

URL Rewrite

Posted on 2011-09-26
3
849 Views
Last Modified: 2012-05-12
I have an asp.net appication hosted on windows server 2008 in IIS7 that has ajax a. nd third party controls. When I hit the site directly it works perfectly. When I hit the site via a reverse proxy I get Sys undefined javascript error. It appears that it is looking for an axd file that is not at the location specified. The url to the server is: https://server.net/sub.dir/default.aspx. The site url via the reverse proxy is https://company.com/sub.dir/default.aspx. I am currently looking into IIS7 URL Rewrite feature to handle accessing the *.axd files. Is there a generic rule that can be written to redirect or rewrite the correct location of the *.axd files, which i believe is the context root directory?
0
Comment
Question by:Khopkins32
[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
  • 2
3 Comments
 
LVL 10

Assisted Solution

by:gaurav05
gaurav05 earned 500 total points
ID: 36708027
0
 

Accepted Solution

by:
Khopkins32 earned 0 total points
ID: 36717074
I looked at the links and I have a better understanding of how to create rules in IIS7 URL Rewrite. The problem is that I am not able to reference the WebResource.axd file. I have tried using the following rule which may or may not be correct: See Below:

<rewrite>
            <rules>
                <rule name="Redirect" enabled="true" stopProcessing="true">
                    <match url="(.*)" />
                    <conditions trackAllCaptures="true">
                        <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
                        <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
                        <add input="{URL}" pattern="\.axd$" />
                    </conditions>
                    <action type="Rewrite" url="{R:0}/" appendQueryString="true" />
                </rule>
            </rules>
        </rewrite>

My question is how can the embedded resource files get referenced from the reverse proxy?

0
 

Author Closing Comment

by:Khopkins32
ID: 36908411
It turns out that the reverse proxy was figured with compression of javascript and was double compressing the resource files. Once compression was remove the site worked as expected
0

Featured Post

Visualize your virtual and backup environments

Create well-organized and polished visualizations of your virtual and backup environments when planning VMware vSphere, Microsoft Hyper-V or Veeam deployments. It helps you to gain better visibility and valuable business insights.

Question has a verified solution.

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

If you are a web developer, you would be aware of the <iframe> tag in HTML. The <iframe> stands for inline frame and is used to embed another document within the current HTML document. The embedded document could be even another website.
This article discusses how to implement server side field validation and display customized error messages to the client.
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

734 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