Newbie question - basic setup

Aug 6, 2009 at 11:14 AM

Hi there

Sorry to ask such a basic question - I've read the readme, and have spent a few hours fiddling with IIS and reading through other forum posts here, but still no luck.  It's probably something really simple and daft I'm doing.

We've got an internet facing server running IIS6 that we use to host a number of small websites.  They are all running on port 80, with different host headers configured for each site.  So we have a number of public DNS records pointing to the same public IP.  I need to use your redirect tool to reverse proxy requests, for example newsite.ourdomain.com to another internal website, running Oracle XE and APEX, that we don't want to expose directly to the internet.

I can't get even the test redirects to work.  I created a new website pointing to c:\newsite called "newsite".  I then copied the contents of your example\Website folder to c:\newsite.  I configured the wildcard setting in IIS as specified in the readme.  If I try to go to newsite.ourdomain.com/redirect/me1.html I just get a page not found error.  It's like the rewriter is not kicking in at all.  If I go to newsite.ourdomain.com/default.aspx the test page works fine.  So the host header stuff seems to be fine.

The site "newsite" is using the default application pool.  I have tried an iisreset.  .Net 1, 1.1, 2.0, 3, 3.5 are installed.  What am I missing here?

thanks so much,

Raymond

Coordinator
Aug 6, 2009 at 2:23 PM

Hi Raymond,

 

I will be happy to help.  First things first.  If you drop an HTML file like default.html or index.html in the newsite folder, does it get returned with out the url rewriter running?  When you do it with the rewriter active does it get returned?

Second lets trim down the rules file to exactly what you need.  Probably a redirect to start with right?  Try this

 

RewriteEngine on

RewriteRule ^/(.*)$               http://www.google.com/   [R=302]

 

This will cause any page on your site to redirect to Google, if that works we can start moving ahead with proxying.

Nick

 

 

Aug 6, 2009 at 2:54 PM

Hi Nick

Many thanks for your quick reply!!  I am so confused – your redirect rule works – the page re-directs to Google.  All I did was overwrite my rule file with your rule below.  The rule we need is super simple – anything hitting the site must be proxied to another internal site.  I suspect my rule syntax was wrong.  Does the whole redirect module not work if there is a syntax error in a rule?  I think I was missing the trailing “$” in my test.  But then again, I'm so sure I tested using only the sample files at one point, and removing my rule file.  Aaargh!  Frustrating when you don't know WHY something works.  But it's better than it not working  ;-)

Would this be the correct syntax to proxy everything to another internally-accessible-only site:-

RewriteRule ^(.*)$          http://mysite.mydomain.com/$1 [P]

Thanks again!
Raymond

<!--[if gte mso 9]><xml> <w:WordDocument> <w:View>Normal</w:View> <w:Zoom>0</w:Zoom> <w:TrackMoves /> <w:TrackFormatting /> <w:PunctuationKerning /> <w:ValidateAgainstSchemas /> <w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid> <w:IgnoreMixedContent>false</w:IgnoreMixedContent> <w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText> <w:DoNotPromoteQF /> <w:LidThemeOther>EN-ZA</w:LidThemeOther> <w:LidThemeAsian>X-NONE</w:LidThemeAsian> <w:LidThemeComplexScript>X-NONE</w:LidThemeComplexScript> <w:Compatibility> <w:BreakWrappedTables /> <w:SnapToGridInCell /> <w:WrapTextWithPunct /> <w:UseAsianBreakRules /> <w:DontGrowAutofit /> <w:SplitPgBreakAndParaMark /> <w:DontVertAlignCellWithSp /> <w:DontBreakConstrainedForcedTables /> <w:DontVertAlignInTxbx /> <w:Word11KerningPairs /> <w:CachedColBalance /> </w:Compatibility> <w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel> <m:mathPr> <m:mathFont m:val="Cambria Math" /> <m:brkBin m:val="before" /> <m:brkBinSub m:val="--" /> <m:smallFrac m:val="off" /> <m:dispDef /> <m:lMargin m:val="0" /> <m:rMargin m:val="0" /> <m:defJc m:val="centerGroup" /> <m:wrapIndent m:val="1440" /> <m:intLim m:val="subSup" /> <m:naryLim m:val="undOvr" /> </m:mathPr></w:WordDocument> </xml><![endif]--><!--[if gte mso 9]><xml> <w:LatentStyles DefLockedState="false" DefUnhideWhenUsed="true" DefSemiHidden="true" DefQFormat="false" DefPriority="99" LatentStyleCount="267"> <w:LsdException Locked="false" Priority="0" SemiHidden="false" UnhideWhenUsed="false" QFormat="true" Name="Normal" /> <w:LsdException Locked="false" Priority="9" SemiHidden="false" UnhideWhenUsed="false" QFormat="true" Name="heading 1" /> <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 2" /> <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 3" /> <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 4" /> <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 5" /> <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 6" /> <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 7" /> <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 8" /> <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 9" /> <w:LsdException Locked="false" Priority="39" Name="toc 1" /> <w:LsdException Locked="false" Priority="39" Name="toc 2" /> <w:LsdException Locked="false" Priority="39" Name="toc 3" /> <w:LsdException Locked="false" Priority="39" Name="toc 4" /> <w:LsdException Locked="false" Priority="39" Name="toc 5" /> <w:LsdException Locked="false" Priority="39" Name="toc 6" /> <w:LsdException Locked="false" Priority="39" Name="toc 7" /> <w:LsdException Locked="false" Priority="39" Name="toc 8" /> <w:LsdException Locked="false" Priority="39" Name="toc 9" /> <w:LsdException Locked="false" Priority="35" QFormat="true" Name="caption" /> <w:LsdException Locked="false" Priority="10" SemiHidden="false" UnhideWhenUsed="false" QFormat="true" Name="Title" /> <w:LsdException Locked="false" Priority="1" Name="Default Paragraph Font" /> <w:LsdException Locked="false" Priority="11" SemiHidden="false" UnhideWhenUsed="false" QFormat="true" Name="Subtitle" /> <w:LsdException Locked="false" Priority="22" SemiHidden="false" UnhideWhenUsed="false" QFormat="true" Name="Strong" /> <w:LsdException Locked="false" Priority="20" SemiHidden="false" UnhideWhenUsed="false" QFormat="true" Name="Emphasis" /> <w:LsdException Locked="false" Priority="59" SemiHidden="false" UnhideWhenUsed="false" Name="Table Grid" /> <w:LsdException Locked="false" UnhideWhenUsed="false" Name="Placeholder Text" /> <w:LsdException Locked="false" Priority="1" SemiHidden="false" UnhideWhenUsed="false" QFormat="true" Name="No Spacing" /> <w:LsdException Locked="false" Priority="60" SemiHidden="false" UnhideWhenUsed="false" Name="Light Shading" /> <w:LsdException Locked="false" Priority="61" SemiHidden="false" UnhideWhenUsed="false" Name="Light List" /> <w:LsdException Locked="false" Priority="62" SemiHidden="false" UnhideWhenUsed="false" Name="Light Grid" /> <w:LsdException Locked="false" Priority="63" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Shading 1" /> <w:LsdException Locked="false" Priority="64" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Shading 2" /> <w:LsdException Locked="false" Priority="65" SemiHidden="false" UnhideWhenUsed="false" Name="Medium List 1" /> <w:LsdException Locked="false" Priority="66" SemiHidden="false" UnhideWhenUsed="false" Name="Medium List 2" /> <w:LsdException Locked="false" Priority="67" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Grid 1" /> <w:LsdException Locked="false" Priority="68" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Grid 2" /> <w:LsdException Locked="false" Priority="69" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Grid 3" /> <w:LsdException Locked="false" Priority="70" SemiHidden="false" UnhideWhenUsed="false" Name="Dark List" /> <w:LsdException Locked="false" Priority="71" SemiHidden="false" UnhideWhenUsed="false" Name="Colorful Shading" /> <w:LsdException Locked="false" Priority="72" SemiHidden="false" UnhideWhenUsed="false" Name="Colorful List" /> <w:LsdException Locked="false" Priority="73" SemiHidden="false" UnhideWhenUsed="false" Name="Colorful Grid" /> <w:LsdException Locked="false" Priority="60" SemiHidden="false" UnhideWhenUsed="false" Name="Light Shading Accent 1" /> <w:LsdException Locked="false" Priority="61" SemiHidden="false" UnhideWhenUsed="false" Name="Light List Accent 1" /> <w:LsdException Locked="false" Priority="62" SemiHidden="false" UnhideWhenUsed="false" Name="Light Grid Accent 1" /> <w:LsdException Locked="false" Priority="63" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Shading 1 Accent 1" /> <w:LsdException Locked="false" Priority="64" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Shading 2 Accent 1" /> <w:LsdException Locked="false" Priority="65" SemiHidden="false" UnhideWhenUsed="false" Name="Medium List 1 Accent 1" /> <w:LsdException Locked="false" UnhideWhenUsed="false" Name="Revision" /> <w:LsdException Locked="false" Priority="34" SemiHidden="false" UnhideWhenUsed="false" QFormat="true" Name="List Paragraph" /> <w:LsdException Locked="false" Priority="29" SemiHidden="false" UnhideWhenUsed="false" QFormat="true" Name="Quote" /> <w:LsdException Locked="false" Priority="30" SemiHidden="false" UnhideWhenUsed="false" QFormat="true" Name="Intense Quote" /> <w:LsdException Locked="false" Priority="66" SemiHidden="false" UnhideWhenUsed="false" Name="Medium List 2 Accent 1" /> <w:LsdException Locked="false" Priority="67" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Grid 1 Accent 1" /> <w:LsdException Locked="false" Priority="68" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Grid 2 Accent 1" /> <w:LsdException Locked="false" Priority="69" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Grid 3 Accent 1" /> <w:LsdException Locked="false" Priority="70" SemiHidden="false" UnhideWhenUsed="false" Name="Dark List Accent 1" /> <w:LsdException Locked="false" Priority="71" SemiHidden="false" UnhideWhenUsed="false" Name="Colorful Shading Accent 1" /> <w:LsdException Locked="false" Priority="72" SemiHidden="false" UnhideWhenUsed="false" Name="Colorful List Accent 1" /> <w:LsdException Locked="false" Priority="73" SemiHidden="false" UnhideWhenUsed="false" Name="Colorful Grid Accent 1" /> <w:LsdException Locked="false" Priority="60" SemiHidden="false" UnhideWhenUsed="false" Name="Light Shading Accent 2" /> <w:LsdException Locked="false" Priority="61" SemiHidden="false" UnhideWhenUsed="false" Name="Light List Accent 2" /> <w:LsdException Locked="false" Priority="62" SemiHidden="false" UnhideWhenUsed="false" Name="Light Grid Accent 2" /> <w:LsdException Locked="false" Priority="63" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Shading 1 Accent 2" /> <w:LsdException Locked="false" Priority="64" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Shading 2 Accent 2" /> <w:LsdException Locked="false" Priority="65" SemiHidden="false" UnhideWhenUsed="false" Name="Medium List 1 Accent 2" /> <w:LsdException Locked="false" Priority="66" SemiHidden="false" UnhideWhenUsed="false" Name="Medium List 2 Accent 2" /> <w:LsdException Locked="false" Priority="67" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Grid 1 Accent 2" /> <w:LsdException Locked="false" Priority="68" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Grid 2 Accent 2" /> <w:LsdException Locked="false" Priority="69" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Grid 3 Accent 2" /> <w:LsdException Locked="false" Priority="70" SemiHidden="false" UnhideWhenUsed="false" Name="Dark List Accent 2" /> <w:LsdException Locked="false" Priority="71" SemiHidden="false" UnhideWhenUsed="false" Name="Colorful Shading Accent 2" /> <w:LsdException Locked="false" Priority="72" SemiHidden="false" UnhideWhenUsed="false" Name="Colorful List Accent 2" /> <w:LsdException Locked="false" Priority="73" SemiHidden="false" UnhideWhenUsed="false" Name="Colorful Grid Accent 2" /> <w:LsdException Locked="false" Priority="60" SemiHidden="false" UnhideWhenUsed="false" Name="Light Shading Accent 3" /> <w:LsdException Locked="false" Priority="61" SemiHidden="false" UnhideWhenUsed="false" Name="Light List Accent 3" /> <w:LsdException Locked="false" Priority="62" SemiHidden="false" UnhideWhenUsed="false" Name="Light Grid Accent 3" /> <w:LsdException Locked="false" Priority="63" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Shading 1 Accent 3" /> <w:LsdException Locked="false" Priority="64" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Shading 2 Accent 3" /> <w:LsdException Locked="false" Priority="65" SemiHidden="false" UnhideWhenUsed="false" Name="Medium List 1 Accent 3" /> <w:LsdException Locked="false" Priority="66" SemiHidden="false" UnhideWhenUsed="false" Name="Medium List 2 Accent 3" /> <w:LsdException Locked="false" Priority="67" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Grid 1 Accent 3" /> <w:LsdException Locked="false" Priority="68" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Grid 2 Accent 3" /> <w:LsdException Locked="false" Priority="69" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Grid 3 Accent 3" /> <w:LsdException Locked="false" Priority="70" SemiHidden="false" UnhideWhenUsed="false" Name="Dark List Accent 3" /> <w:LsdException Locked="false" Priority="71" SemiHidden="false" UnhideWhenUsed="false" Name="Colorful Shading Accent 3" /> <w:LsdException Locked="false" Priority="72" SemiHidden="false" UnhideWhenUsed="false" Name="Colorful List Accent 3" /> <w:LsdException Locked="false" Priority="73" SemiHidden="false" UnhideWhenUsed="false" Name="Colorful Grid Accent 3" /> <w:LsdException Locked="false" Priority="60" SemiHidden="false" UnhideWhenUsed="false" Name="Light Shading Accent 4" /> <w:LsdException Locked="false" Priority="61" SemiHidden="false" UnhideWhenUsed="false" Name="Light List Accent 4" /> <w:LsdException Locked="false" Priority="62" SemiHidden="false" UnhideWhenUsed="false" Name="Light Grid Accent 4" /> <w:LsdException Locked="false" Priority="63" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Shading 1 Accent 4" /> <w:LsdException Locked="false" Priority="64" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Shading 2 Accent 4" /> <w:LsdException Locked="false" Priority="65" SemiHidden="false" UnhideWhenUsed="false" Name="Medium List 1 Accent 4" /> <w:LsdException Locked="false" Priority="66" SemiHidden="false" UnhideWhenUsed="false" Name="Medium List 2 Accent 4" /> <w:LsdException Locked="false" Priority="67" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Grid 1 Accent 4" /> <w:LsdException Locked="false" Priority="68" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Grid 2 Accent 4" /> <w:LsdException Locked="false" Priority="69" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Grid 3 Accent 4" /> <w:LsdException Locked="false" Priority="70" SemiHidden="false" UnhideWhenUsed="false" Name="Dark List Accent 4" /> <w:LsdException Locked="false" Priority="71" SemiHidden="false" UnhideWhenUsed="false" Name="Colorful Shading Accent 4" /> <w:LsdException Locked="false" Priority="72" SemiHidden="false" UnhideWhenUsed="false" Name="Colorful List Accent 4" /> <w:LsdException Locked="false" Priority="73" SemiHidden="false" UnhideWhenUsed="false" Name="Colorful Grid Accent 4" /> <w:LsdException Locked="false" Priority="60" SemiHidden="false" UnhideWhenUsed="false" Name="Light Shading Accent 5" /> <w:LsdException Locked="false" Priority="61" SemiHidden="false" UnhideWhenUsed="false" Name="Light List Accent 5" /> <w:LsdException Locked="false" Priority="62" SemiHidden="false" UnhideWhenUsed="false" Name="Light Grid Accent 5" /> <w:LsdException Locked="false" Priority="63" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Shading 1 Accent 5" /> <w:LsdException Locked="false" Priority="64" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Shading 2 Accent 5" /> <w:LsdException Locked="false" Priority="65" SemiHidden="false" UnhideWhenUsed="false" Name="Medium List 1 Accent 5" /> <w:LsdException Locked="false" Priority="66" SemiHidden="false" UnhideWhenUsed="false" Name="Medium List 2 Accent 5" /> <w:LsdException Locked="false" Priority="67" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Grid 1 Accent 5" /> <w:LsdException Locked="false" Priority="68" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Grid 2 Accent 5" /> <w:LsdException Locked="false" Priority="69" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Grid 3 Accent 5" /> <w:LsdException Locked="false" Priority="70" SemiHidden="false" UnhideWhenUsed="false" Name="Dark List Accent 5" /> <w:LsdException Locked="false" Priority="71" SemiHidden="false" UnhideWhenUsed="false" Name="Colorful Shading Accent 5" /> <w:LsdException Locked="false" Priority="72" SemiHidden="false" UnhideWhenUsed="false" Name="Colorful List Accent 5" /> <w:LsdException Locked="false" Priority="73" SemiHidden="false" UnhideWhenUsed="false" Name="Colorful Grid Accent 5" /> <w:LsdException Locked="false" Priority="60" SemiHidden="false" UnhideWhenUsed="false" Name="Light Shading Accent 6" /> <w:LsdException Locked="false" Priority="61" SemiHidden="false" UnhideWhenUsed="false" Name="Light List Accent 6" /> <w:LsdException Locked="false" Priority="62" SemiHidden="false" UnhideWhenUsed="false" Name="Light Grid Accent 6" /> <w:LsdException Locked="false" Priority="63" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Shading 1 Accent 6" /> <w:LsdException Locked="false" Priority="64" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Shading 2 Accent 6" /> <w:LsdException Locked="false" Priority="65" SemiHidden="false" UnhideWhenUsed="false" Name="Medium List 1 Accent 6" /> <w:LsdException Locked="false" Priority="66" SemiHidden="false" UnhideWhenUsed="false" Name="Medium List 2 Accent 6" /> <w:LsdException Locked="false" Priority="67" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Grid 1 Accent 6" /> <w:LsdException Locked="false" Priority="68" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Grid 2 Accent 6" /> <w:LsdException Locked="false" Priority="69" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Grid 3 Accent 6" /> <w:LsdException Locked="false" Priority="70" SemiHidden="false" UnhideWhenUsed="false" Name="Dark List Accent 6" /> <w:LsdException Locked="false" Priority="71" SemiHidden="false" UnhideWhenUsed="false" Name="Colorful Shading Accent 6" /> <w:LsdException Locked="false" Priority="72" SemiHidden="false" UnhideWhenUsed="false" Name="Colorful List Accent 6" /> <w:LsdException Locked="false" Priority="73" SemiHidden="false" UnhideWhenUsed="false" Name="Colorful Grid Accent 6" /> <w:LsdException Locked="false" Priority="19" SemiHidden="false" UnhideWhenUsed="false" QFormat="true" Name="Subtle Emphasis" /> <w:LsdException Locked="false" Priority="21" SemiHidden="false" UnhideWhenUsed="false" QFormat="true" Name="Intense Emphasis" /> <w:LsdException Locked="false" Priority="31" SemiHidden="false" UnhideWhenUsed="false" QFormat="true" Name="Subtle Reference" /> <w:LsdException Locked="false" Priority="32" SemiHidden="false" UnhideWhenUsed="false" QFormat="true" Name="Intense Reference" /> <w:LsdException Locked="false" Priority="33" SemiHidden="false" UnhideWhenUsed="false" QFormat="true" Name="Book Title" /> <w:LsdException Locked="false" Priority="37" Name="Bibliography" /> <w:LsdException Locked="false" Priority="39" QFormat="true" Name="TOC Heading" /> </w:LatentStyles> </xml><![endif]--><!-- /* Font Definitions */ @font-face {font-family:"Cambria Math"; panose-1:2 4 5 3 5 4 6 3 2 4; mso-font-charset:0; mso-generic-font-family:roman; mso-font-pitch:variable; mso-font-signature:-1610611985 1107304683 0 0 415 0;} @font-face {font-family:Calibri; panose-1:2 15 5 2 2 2 4 3 2 4; mso-font-charset:0; mso-generic-font-family:swiss; mso-font-pitch:variable; mso-font-signature:-520092929 1073786111 9 0 415 0;} /* Style Definitions */ p.MsoNormal, li.MsoNormal, div.MsoNormal {mso-style-unhide:no; mso-style-qformat:yes; mso-style-parent:""; margin:0cm; margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:12.0pt; font-family:"Times New Roman","serif"; mso-fareast-font-family:Calibri; mso-fareast-theme-font:minor-latin;} a:link, span.MsoHyperlink {mso-style-priority:99; color:blue; text-decoration:underline; text-underline:single;} a:visited, span.MsoHyperlinkFollowed {mso-style-noshow:yes; mso-style-priority:99; color:purple; mso-themecolor:followedhyperlink; text-decoration:underline; text-underline:single;} .MsoChpDefault {mso-style-type:export-only; mso-default-props:yes; font-size:10.0pt; mso-ansi-font-size:10.0pt; mso-bidi-font-size:10.0pt;} @page Section1 {size:612.0pt 792.0pt; margin:72.0pt 72.0pt 72.0pt 72.0pt; mso-header-margin:36.0pt; mso-footer-margin:36.0pt; mso-paper-source:0;} div.Section1 {page:Section1;} --><!--[if gte mso 10]> <mce:style><! /* Style Definitions */ table.MsoNormalTable {mso-style-name:"Table Normal"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-priority:99; mso-style-qformat:yes; mso-style-parent:""; mso-padding-alt:0cm 5.4pt 0cm 5.4pt; mso-para-margin:0cm; mso-para-margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:11.0pt; font-family:"Calibri","sans-serif"; mso-ascii-font-family:Calibri; mso-ascii-theme-font:minor-latin; mso-fareast-font-family:"Times New Roman"; mso-fareast-theme-font:minor-fareast; mso-hansi-font-family:Calibri; mso-hansi-theme-font:minor-latin; mso-bidi-font-family:"Times New Roman"; mso-bidi-theme-font:minor-bidi;} --> <!--[endif]-->

Hi Nick

Many thanks for your quick reply!! 

I am so confused – your redirect rule works – the page re-directs to Google.  All I did was overwrite my rule file with your rule below.  The rule we need is super simple – anything hitting the site must be proxied to another internal site.  I suspect my rule syntax was wrong.  Does the whole redirect module not work if there is a syntax error in a rule?  I think I was missing the trailing “$” in my test.

Would this be the correct syntax to proxy everything to another internally-accessible-only site:-

RewriteRule ^(.*)$          http://mysite.mydomain.com/$1 [P]

Thanks again!

Raymond

Coordinator
Aug 6, 2009 at 4:32 PM

Your syntax is correct.  Except your URL probably comes out looking like http://mysite.mydomain.com//my-address-i-typed-in.html, because you are not keeping your slashes consistant, try this:

 

RewriteRule ^/(.*)$          http://mysite.mydomain.com/$1 [P]

 

But things to check for when proxying are:

Can your machine access the internal website?

Can your machine access the internal website (http://mysite.mydomain.com) or do you need to use a network address like (http://myinternalsite)

If you are getting a 404 error that is great, because it means the proxying is working, because you internal site is returning a 404 error.  The next step would be to see why the site is returning a 404 error and what when wrong with the URL transfer.

If you are running the latest code from the download tab, then if the website doesn't return anything a 400 error is returned.

My suggestion is do the following:

 

RewriteEngine on

RewriteLog "log.txt"

RewriteLogLevel 9

RewriteRule ^/(.*)$          http://mysite.mydomain.com/$1 [P]

 

let me know, that should create a log.txt file in your website directory so you can see the output URL.

Aug 7, 2009 at 10:17 AM
Edited Aug 7, 2009 at 10:32 AM

Hi Nick

Here are my rules, as per your suggestions:-

RewriteEngine on

RewriteLog "log.txt"

RewriteLogLevel 9

RewriteRule ^/(.*)$        http://myinternalsite:8080/apex/apex_admin/$1 [P]

However, I get this web app error below, and no log file is written.  I’ve tried giving the IUSR_SERVERNAME local account write access to my web site’s folder “c:\my folder” to no avail.  Are there any permissions I should be setting in IIS or on the filesystem for ReWriter?  Surely the app shouldn’t have a whole lot of hard coded references to your user profile?  Or are these just incidental that I’m seeing in the error output?

Server Error in '/' Application.

--------------------------------------------------------------------------------

The relative virtual path 'log.txt' is not allowed here.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.ArgumentException: The relative virtual path 'log.txt' is not allowed here.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. 

Stack Trace:

[ArgumentException: The relative virtual path 'log.txt' is not allowed here.]

   System.Web.VirtualPath.FailIfRelativePath() +8830668

   System.Web.Hosting.HostingEnvironment.MapPathActual(VirtualPath virtualPath, Boolean permitNull) +49

   System.Web.Hosting.HostingEnvironment.MapPathInternal(VirtualPath virtualPath) +42

   System.Web.Hosting.HostingEnvironment.MapPath(VirtualPath virtualPath) +51

   System.Web.Hosting.HostingEnvironment.MapPath(String virtualPath) +19

   ManagedFusion.Rewriter.Engines.ApacheRuleSet.RefreshRules(TextReader reader) in C:\Users\Nick\Documents\Projects\Managed Fusion\ManagedFusion.Rewriter\Source\Engines\ApacheRuleSet.cs:487

   ManagedFusion.Rewriter.Engines.ApacheRuleSet.RefreshRules() in C:\Users\Nick\Documents\Projects\Managed Fusion\ManagedFusion.Rewriter\Source\Engines\ApacheRuleSet.cs:378

   ManagedFusion.Rewriter.Engines.ApacheEngine.RefreshRules() in C:\Users\Nick\Documents\Projects\Managed Fusion\ManagedFusion.Rewriter\Source\Engines\ApacheEngine.cs:271

   ManagedFusion.Rewriter.Engines.ApacheEngine.Init() in C:\Users\Nick\Documents\Projects\Managed Fusion\ManagedFusion.Rewriter\Source\Engines\ApacheEngine.cs:262

   ManagedFusion.Rewriter.Manager..cctor() in C:\Users\Nick\Documents\Projects\Managed Fusion\ManagedFusion.Rewriter\Source\Manager.cs:290

[TypeInitializationException: The type initializer for 'ManagedFusion.Rewriter.Manager' threw an exception.]

   ManagedFusion.Rewriter.Manager.get_ApplicationRulesNeedLoading() in C:\Users\Nick\Documents\Projects\Managed Fusion\ManagedFusion.Rewriter\Source\Manager.cs:83

   ManagedFusion.Rewriter.RewriterModule.context_BeginRequest(Object sender, EventArgs e) in C:\Users\Nick\Documents\Projects\Managed Fusion\ManagedFusion.Rewriter\Source\RewriterModule.cs:111

   System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +68

   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +75

Thanks

Ray

Coordinator
Aug 7, 2009 at 1:05 PM

I am sorry try

 

RewriteLog "/log.txt"

Aug 7, 2009 at 1:48 PM

Thanks Nic.  The log file is working now.  If I try to go to the site, I get a 400 error (Bad Request).  However, the log seems to indicate that the proxying is working:-

Rewrite: Input: http://externalsite.myexternaldomainname.com/

Rule 0: Input: /

Rule 0: Rule Pattern Matched

Rule 0: Output: http://internalsite.mydomainname.com:8080/apex/apex_admin/

Rewrite: Proxy: http://internalsite.mydomainname.com:8080/apex/apex_admin/

The Apex site requires two logons, which are done via a Windows-style authentication dialog box, not via an inline html form.  It works fine when I access the site directly using http://internalsite.mydomainname.com:8080/apex/apex_admin/.  Any ideas?

Ray

From: nberardi [mailto:notifications@codeplex.com]
Sent: 07 August 2009 02:06 PM
To: Raymond Diack
Subject: Re: Newbie question - basic setup [urlrewriter:64685]

From: nberardi

I am sorry try

RewriteLog "/log.txt"

Read the full discussion online.

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

To start a new discussion for this project, email urlrewriter@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

Coordinator
Aug 7, 2009 at 5:03 PM

Yeah it is working correctly, it just cannot connect to

http://internalsite.mydomainname.com:8080/apex/apex_admin/

Try going to the server and making a request to the URL.  

Aug 11, 2009 at 2:51 PM
Edited Aug 11, 2009 at 2:54 PM

Hi Nick

If I log onto the server, and then open up IE and browse to the server using the URL below, I get to the Apex admin page (after entering in credentials twice).  So it doesn’t seem like there is a problem actually getting to the destination site, as I can get to it manually. 

I’ve modified my rule to the below:-

RewriteRule ^/(.*)$    http://internalsite.mydomainname.com:8080/$1 [P]

Am I right in saying that should proxy any requests to the corresponding URL on the destination server?  E.g if I go:-

http://externalsite.externaldomain.com/apex/apex_admin it should proxy to http://internalsite.mydomainname.com:8080/apex/apex_admin   ?

That’s ultimately what we’ll need to do – I was just using the apex site as a test.  For the above rule, if I enter the URL with no trailing path after the “.com”, it successfully shows the Index of the root of the destination server.  If I then click on a valid subfolder, it gives me an IIS page not found – looks like the rule is not kicking in for anything other than the root path (i.e. it works for externalsite.externaldomain.com, but not externalsite.externaldomain.com/somepath).

Thanks

Ray

Coordinator
Aug 11, 2009 at 5:13 PM
Edited Aug 11, 2009 at 5:14 PM

If you have this rule:

RewriteRule ^/(.*)$    http://internalsite.mydomainname.com:8080/$1 [P]

It should proxy everything path exactly the same way.  However I have learned with proxying and site design sometimes some helper rules are needed to correctly proxy through some corner cases.  I would have to know what the URL it was kicking you in to looked like from the HTML perspective.  If it is a relative URL, such as "../admin/something" then you may need another helper rule, if it is an absolute rule such as "/admin/something" then we might need to troubleshoot a little more.

Also out of curiousity let me know what this does, and if it changes anything:

RewriteRule ^(.*)$    http://internalsite.mydomainname.com:8080$1 [P]

Aug 12, 2009 at 7:54 AM

Hmm what do you suggest moving forward?  Should we perhaps take this thread offline so I can share with you the actual URL’s we’re using?  Or could you possibly point me in the right direction in terms of doing some more detailed troubleshooting?  I’m not sure where to look, as IIS is not one of my strengths.

Coordinator
Aug 12, 2009 at 12:19 PM
Edited Aug 12, 2009 at 12:22 PM

Contact me using the contact page on http://www.managedfusion.com/info/contact-us.aspx

Aug 12, 2009 at 12:58 PM

Hi  again – sorry if i’m missing something here – but I don’t think I have your address.  I’ve only been using the forum, but via email.  Please could you mail me on Raymond at 2cana dot co dot za.

Thanks!!

Ray