IIS 7 URL Rewriting

This forum is only for questions or discussions about working with the mojoPortal source code in Visual Studio, obtaining the source code from the repository, developing custom features, etc. If your question is not along these lines this is not the right forum. Please try to post your question in the appropriate forum.

Please do not post questions about design, CSS, or skinning here. Use the Help With Skins Forum for those questions.

This forum is for discussing mojoPortal development

This forum is only for questions or discussions about working with the mojoPortal source code in Visual Studio, obtaining the source code from the repository, developing custom features, etc. If your question is not along these lines this is not the right forum. Please try to post your question in the appropriate forum.

You can monitor commits to the repository from this page. We also recommend developers to subscribe to email notifications in the developer forum as occasionally important things are announced.

Before posting questions here you might want to review the developer documentation.

Do not post questions about design, CSS, or skinning here. Use the Help With Skins Forum for those questions.
This thread is closed to new posts. You must sign in to post in the forums.
7/13/2010 3:28:38 PM
Gravatar
Total Posts 35

IIS 7 URL Rewriting

I just wanted to see if anyone had worked with URL Rewriting.

I have a page with a control that has an IFrame in it that points to another site with the an sessionId passed in the query string.  When I use URL Rewriting, it only applies the Patterns to the main page and not the IFrame'd page.

 

Ex.

/Page1.aspx has a control with an IFrame to /dir2/index?sId=23234-23-234-234ae3-234cde23423

URL Pattern is "dir2/*", which then rewrites to http://newserver/blah/db/index?sId=23234-23-234-234ae3-234cde23423

 

Looking through the logs, it tries to match the pattern on /Page1.aspx, but not on the IFrame address.

 

Anyone ever worked with URL Rewriting in IIS?

 

Thanks

7/14/2010 7:21:35 AM
Gravatar
Total Posts 18439

Re: IIS 7 URL Rewriting

Your server does not handle requests for external web pages so you cannot do any url re-writing on them. Your server just serves up an html page with the iframe pointing to some other site, then the user's browser makes a separate web request to that site to load the page in the iframe without any involvement of your server.

The IIS Url Rewriter is not involved in rendering page markup so it is not going to append anything to the url for the iframe, it only routes requests that come to your server.

Hope it helps,

Joe

7/14/2010 8:07:57 AM
Gravatar
Total Posts 35

Re: IIS 7 URL Rewriting

The pattern matching should actually be on "dir2/*",  which is on my server.  Then, it will build the Iframe using the sId in the query string.

It's kind of like a dynamic Iframe builder.

I know there is a way to do it, b/c we have it working on a Prod server and I'm trying to get it to work on a QA server I am building.  I just can't seem to figure out what I am missing and the person that did it is no longer here.

 

This is not Mojo-related, but I really appreciate your time.     If I find out, I'll post back here.

 

Thanks again.

7/14/2010 8:26:50 AM
Gravatar
Total Posts 2239

Re: IIS 7 URL Rewriting

Hi,

I have used the IIS 7 URL Rewriter quite a bit and it usually takes some finessing. It is a very powerful utility but can be easy to jack up. I think what you need in your case is to set the pattern to "*/dir2/*".

Also, can you not look at the configuration of the URL Rewriter on the Production server to get some ideas?

The IIS.net website is full of help for the URL rewriter. You should probably start here: http://learn.iis.net/page.aspx/460/using-the-url-rewrite-module/.

HTH,
Joe D.

9/9/2010 10:01:36 AM
Gravatar
Total Posts 35

Re: IIS 7 URL Rewriting

I fixed this a while ago and wanted to update this in case anyone else runs into similar issues with IIS URL Rewriting.

 

This is not specific to MojoPortal at all.  This is a IIS 7 URL Rewrite configuration.

 

Be careful where you define the "URL Rewrite" rules.  I had the rules defined at both the server level and at the site level.  I did not know that they were at separate levels because the rules looked identical.  This caused a conflict when it tried to rewrite the URL.

 

I deleted the rules from the Server level URL Rewrite and left them along in the Site level URL Rewrite.

 

Thanks to everyone that replied.

You must sign in to post in the forums. This thread is closed to new posts.