[Mono-bugs] [Bug 76769][Nor] New - mod_mono doesn't work with apaches mod_rewrite

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Sun Nov 20 08:27:22 EST 2005


Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.

Changed by gupe275 at hotmail.com.

http://bugzilla.ximian.com/show_bug.cgi?id=76769

--- shadow/76769	2005-11-20 08:27:21.000000000 -0500
+++ shadow/76769.tmp.10663	2005-11-20 08:27:22.000000000 -0500
@@ -0,0 +1,108 @@
+Bug#: 76769
+Product: Mono: Tools
+Version: unspecified
+OS: 
+OS Details: gentoo
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Normal
+Component: mod_mono
+AssignedTo: gonzalo at ximian.com                            
+ReportedBy: gupe275 at hotmail.com               
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: mod_mono doesn't work with apaches mod_rewrite
+
+Description of Problem:
+When trying to do a rewrite mod_mono complains about Directory not found.
+
+I'm not sure if it's mod_mono or apache/mod_rewrite that at fault.
+I would have thought that the rewrite would have happened transperantly to
+mod_mono. The same config works fine for with .php page in the rule.
+
+
+1. Add a RewriteRule in apache conf
+RewriteRule ^/([0-9]+)/$ /test.aspx?sid=$1 
+2. Browse to url /131072/ which should be rewritten, internaly, to
+/test.aspx?sid=131072 without the browser knowing it. the browser should
+still stay at /131072/.
+
+
+Actual Results:
+Stacktrace:
+
+System.IO.DirectoryNotFoundException: Directory
+'/var/www/my.website.com/131072' not found.
+in <0x00242> System.IO.StreamReader:.ctor (System.String path,
+System.Text.Encoding encoding, Boolean detect_encoding_from_bytemarks,
+Int32 buffer_size)
+in <0x00017> System.IO.StreamReader:.ctor (System.String path,
+System.Text.Encoding encoding)
+in (wrapper remoting-invoke-with-check) System.IO.StreamReader:.ctor
+(string,System.Text.Encoding)
+in <0x0003c> System.Web.Compilation.AspGenerator:InitParser (System.String
+filename)
+in <0x000c9> System.Web.Compilation.AspGenerator:GetCompiledType ()
+in <0x00029> System.Web.UI.PageParser:CompileIntoType ()
+in <0x00011> System.Web.UI.TemplateControlParser:GetCompiledInstance ()
+in <0x00035> System.Web.UI.PageParser:GetCompiledPageInstance
+(System.String virtualPath, System.String inputFile, System.Web.HttpContext
+context)
+in <0x00010> System.Web.UI.PageHandlerFactory:GetHandler
+(System.Web.HttpContext context, System.String requestType, System.String
+url, System.String path)
+in <0x001e6> System.Web.HttpApplication:GetHandler (System.Web.HttpContext
+context)
+in <0x00b8a> System.Web.HttpApplication+<Pipeline>__1:MoveNext ()
+
+
+
+
+apache mod_rewrite log:
+192.168.0.6 - - [20/Nov/2005:13:08:04 +0100]
+[my.website.com/sid#80c3d08][rid#8696c70/initial] (2) init rewrite engine
+with requested uri /131072/
+192.168.0.6 - - [20/Nov/2005:13:08:04 +0100]
+[my.website.com/sid#80c3d08][rid#8696c70/initial] (3) applying pattern
+'^/([0-9]+)/$' to uri '/131072/'
+192.168.0.6 - - [20/Nov/2005:13:08:04 +0100]
+[my.website.com/sid#80c3d08][rid#8696c70/initial] (2) rewrite /131072/ ->
+/test.aspx?sid=131072
+192.168.0.6 - - [20/Nov/2005:13:08:04 +0100]
+[my.website.com/sid#80c3d08][rid#8696c70/initial] (3) split
+uri=/test.aspx?sid=131072 -> uri=/test.aspx, args=sid=131072
+192.168.0.6 - - [20/Nov/2005:13:08:04 +0100]
+[my.website.com/sid#80c3d08][rid#8696c70/initial] (3) applying pattern
+'^/[0-9]+/([0-9]+)/' to uri '/test.aspx'
+192.168.0.6 - - [20/Nov/2005:13:08:04 +0100]
+[my.website.com/sid#80c3d08][rid#8696c70/initial] (2) local path result:
+/test.aspx
+192.168.0.6 - - [20/Nov/2005:13:08:04 +0100]
+[my.website.com/sid#80c3d08][rid#8696c70/initial] (2) prefixed with
+document_root to /var/www/my.website.com/test.aspx
+192.168.0.6 - - [20/Nov/2005:13:08:04 +0100]
+[my.website.com/sid#80c3d08][rid#8696c70/initial] (1) go-ahead with
+/var/www/my.website.com/test.aspx [OK]
+
+
+
+Expected Results:
+mod_mono should serve test.aspx with correct querystring without sending
+Location header to browser.
+
+How often does this happen? 
+every time.
+
+Additional Information:
+RewriteRule ^/([0-9]+)/$ /test.aspx?sid=$1 [R=302,L]
+works but that sends a Location header to the browser thus changing the
+browser address to /test.aspx?sid=131072
+
+Exact same config works for php
+RewriteRule ^/([0-9]+)/$ /test.php?sid=$1
+
+Mono 1.1.10, mod_mono 1.1.10, xsp 1.1.10
+Using mod-mono-server2


More information about the mono-bugs mailing list