global.asax issue

global.asax issue

am 23.01.2008 08:54:47 von Tem

I've been stuck on this error for days.
I use global.asax to do url rewrite. which works fine on one server but not
the other. they are both windows server 2003 R2 IIS6.

if I do
http://test.com/photo/123
which would rewrite to http://test.com/photo/default.aspx?photo=123

on the server that doesn't work, it gives me a 404 error

but if I go and create a 123 folder under photo and a blank default.aspx, it
would work and display the correct page.
so this means global.asax is not being triggered

There must be a setting somewhere
Please help

Tem

Re: global.asax issue

am 23.01.2008 10:45:09 von Leon Mayne

"Tem" wrote in message
news:%23DaR$UZXIHA.5880@TK2MSFTNGP04.phx.gbl...
> I've been stuck on this error for days.
> I use global.asax to do url rewrite. which works fine on one server but
> not the other. they are both windows server 2003 R2 IIS6.
>
> if I do
> http://test.com/photo/123
> which would rewrite to http://test.com/photo/default.aspx?photo=123
>
> on the server that doesn't work, it gives me a 404 error
>
> but if I go and create a 123 folder under photo and a blank default.aspx,
> it would work and display the correct page.
> so this means global.asax is not being triggered
>
> There must be a setting somewhere
> Please help

Make sure the folder the global.asax is sitting in is configured as an
application in IIS, and that there is a web.config in the folder with it.

Re: global.asax issue

am 23.01.2008 10:45:09 von Leon Mayne

"Tem" wrote in message
news:%23DaR$UZXIHA.5880@TK2MSFTNGP04.phx.gbl...
> I've been stuck on this error for days.
> I use global.asax to do url rewrite. which works fine on one server but
> not the other. they are both windows server 2003 R2 IIS6.
>
> if I do
> http://test.com/photo/123
> which would rewrite to http://test.com/photo/default.aspx?photo=123
>
> on the server that doesn't work, it gives me a 404 error
>
> but if I go and create a 123 folder under photo and a blank default.aspx,
> it would work and display the correct page.
> so this means global.asax is not being triggered
>
> There must be a setting somewhere
> Please help

Make sure the folder the global.asax is sitting in is configured as an
application in IIS, and that there is a web.config in the folder with it.

Re: global.asax issue

am 23.01.2008 10:56:46 von grava

"Leon Mayne" wrote in message
news:FA21A20A-D3A6-4E30-B598-349DF3E646DA@microsoft.com...
> "Tem" wrote in message
> news:%23DaR$UZXIHA.5880@TK2MSFTNGP04.phx.gbl...
>> I've been stuck on this error for days.
>> I use global.asax to do url rewrite. which works fine on one server but
>> not the other. they are both windows server 2003 R2 IIS6.
>>
>> if I do
>> http://test.com/photo/123
>> which would rewrite to http://test.com/photo/default.aspx?photo=123
>>
>> on the server that doesn't work, it gives me a 404 error
>>
>> but if I go and create a 123 folder under photo and a blank default.aspx,
>> it would work and display the correct page.
>> so this means global.asax is not being triggered
>>
>> There must be a setting somewhere
>> Please help
>
> Make sure the folder the global.asax is sitting in is configured as an
> application in IIS, and that there is a web.config in the folder with it.

Check IIS Configuration settings and check that IIS isn't checking for
existence of the page!!!!

I don't know how to do for a page without extension like yours, but if you
map something like "123.do" and check the extension ".do" configuration in
IIS -> Properties -> Applcation Configuration -> mappings ... you'll find a
checkbox "Check that file exists" in your ".do" mapping configuration.

HTH


--
Gianluca Gravina
http://blogs.ugidotnet.org/thinkingingrava

Re: global.asax issue

am 23.01.2008 10:56:46 von grava

"Leon Mayne" wrote in message
news:FA21A20A-D3A6-4E30-B598-349DF3E646DA@microsoft.com...
> "Tem" wrote in message
> news:%23DaR$UZXIHA.5880@TK2MSFTNGP04.phx.gbl...
>> I've been stuck on this error for days.
>> I use global.asax to do url rewrite. which works fine on one server but
>> not the other. they are both windows server 2003 R2 IIS6.
>>
>> if I do
>> http://test.com/photo/123
>> which would rewrite to http://test.com/photo/default.aspx?photo=123
>>
>> on the server that doesn't work, it gives me a 404 error
>>
>> but if I go and create a 123 folder under photo and a blank default.aspx,
>> it would work and display the correct page.
>> so this means global.asax is not being triggered
>>
>> There must be a setting somewhere
>> Please help
>
> Make sure the folder the global.asax is sitting in is configured as an
> application in IIS, and that there is a web.config in the folder with it.

Check IIS Configuration settings and check that IIS isn't checking for
existence of the page!!!!

I don't know how to do for a page without extension like yours, but if you
map something like "123.do" and check the extension ".do" configuration in
IIS -> Properties -> Applcation Configuration -> mappings ... you'll find a
checkbox "Check that file exists" in your ".do" mapping configuration.

HTH


--
Gianluca Gravina
http://blogs.ugidotnet.org/thinkingingrava

Re: global.asax issue

am 23.01.2008 15:42:26 von Alan Silver

In article <#DaR$UZXIHA.5880@TK2MSFTNGP04.phx.gbl>, Tem
writes
>I've been stuck on this error for days.
>I use global.asax to do url rewrite. which works fine on one server but
>not the other. they are both windows server 2003 R2 IIS6.

OK, not sure why it works on one server, but I can tell you it's not
working on the other ;-)

>if I do
>http://test.com/photo/123

which doesn't have an .aspx ending, so the request will not be passed to
the ASP.NET engine...

>which would rewrite to http://test.com/photo/default.aspx?photo=123

....assuming it gets passed to ASP.NET, which it shouldn't. I am at a
loss as to how this works on any machine, unless you've configured IIS
to pass EVERY request to ASP.NET

>on the server that doesn't work, it gives me a 404 error

Correct, because IIS itself can't find such a folder.

>but if I go and create a 123 folder under photo and a blank
>default.aspx,

so the request now gets passed to ASP.NET

>it would work and display the correct page.

as ASP.NET processes the request, so the code in your global.asax is
being given chance to run.

>so this means global.asax is not being triggered

No, because the request was not being passed to ASP.NET

>There must be a setting somewhere

Not quite, it's more a case of rethinking how you are going to do URL
rewriting, unless you want to pass every single request through ASP.NET,
which is a very good idea ;-)

>Please help

How about doing the rewriting like this...

http://test.com/photo123.aspx

which would rewrite to...

http://test.com/photo/default.aspx?photo=123

That would be fairly easy, and should work without problem.

I know the idea of URL rewriting without any file endings would be nice,
but it's not practical in most cases. This is one instance where
mod_rewrite has some advantages over URL rewriting as it works at the
server level, not at the script-processing level.

HTH

--
Alan Silver
(anything added below this line is nothing to do with me)

Re: global.asax issue

am 23.01.2008 15:42:26 von Alan Silver

In article <#DaR$UZXIHA.5880@TK2MSFTNGP04.phx.gbl>, Tem
writes
>I've been stuck on this error for days.
>I use global.asax to do url rewrite. which works fine on one server but
>not the other. they are both windows server 2003 R2 IIS6.

OK, not sure why it works on one server, but I can tell you it's not
working on the other ;-)

>if I do
>http://test.com/photo/123

which doesn't have an .aspx ending, so the request will not be passed to
the ASP.NET engine...

>which would rewrite to http://test.com/photo/default.aspx?photo=123

....assuming it gets passed to ASP.NET, which it shouldn't. I am at a
loss as to how this works on any machine, unless you've configured IIS
to pass EVERY request to ASP.NET

>on the server that doesn't work, it gives me a 404 error

Correct, because IIS itself can't find such a folder.

>but if I go and create a 123 folder under photo and a blank
>default.aspx,

so the request now gets passed to ASP.NET

>it would work and display the correct page.

as ASP.NET processes the request, so the code in your global.asax is
being given chance to run.

>so this means global.asax is not being triggered

No, because the request was not being passed to ASP.NET

>There must be a setting somewhere

Not quite, it's more a case of rethinking how you are going to do URL
rewriting, unless you want to pass every single request through ASP.NET,
which is a very good idea ;-)

>Please help

How about doing the rewriting like this...

http://test.com/photo123.aspx

which would rewrite to...

http://test.com/photo/default.aspx?photo=123

That would be fairly easy, and should work without problem.

I know the idea of URL rewriting without any file endings would be nice,
but it's not practical in most cases. This is one instance where
mod_rewrite has some advantages over URL rewriting as it works at the
server level, not at the script-processing level.

HTH

--
Alan Silver
(anything added below this line is nothing to do with me)

Re: global.asax issue

am 23.01.2008 16:18:44 von grava

>
> http://test.com/photo123.aspx
>
> which would rewrite to...
>
> http://test.com/photo/default.aspx?photo=123
>
> That would be fairly easy, and should work without problem.
>

You have to Check again that you haven't the checkBox "Check that file
exists" checked in iis mapping configuration. I had same problems with
Monorail Deployment in production environment !

HTH


--
Gianluca Gravina
http://blogs.ugidotnet.org/thinkingingrava

Re: global.asax issue

am 23.01.2008 16:18:44 von grava

>
> http://test.com/photo123.aspx
>
> which would rewrite to...
>
> http://test.com/photo/default.aspx?photo=123
>
> That would be fairly easy, and should work without problem.
>

You have to Check again that you haven't the checkBox "Check that file
exists" checked in iis mapping configuration. I had same problems with
Monorail Deployment in production environment !

HTH


--
Gianluca Gravina
http://blogs.ugidotnet.org/thinkingingrava

RE: global.asax issue

am 23.01.2008 17:53:01 von FabrizioCipriani

"Tem" wrote:

> I've been stuck on this error for days.
> I use global.asax to do url rewrite. which works fine on one server but not
> the other. they are both windows server 2003 R2 IIS6.
>
> if I do
> http://test.com/photo/123
> which would rewrite to http://test.com/photo/default.aspx?photo=123
>
> on the server that doesn't work, it gives me a 404 error
>
> but if I go and create a 123 folder under photo and a blank default.aspx, it
> would work and display the correct page.
> so this means global.asax is not being triggered
>
> There must be a setting somewhere
> Please help
>
> Tem

If your problem is to redirect extensionless urls, check
http://msmvps.com/blogs/omar/archive/2007/04/29/serve-extens ionless-url-from-asp-net-without-using-isapi-module-or-iis-6 -wildcard-mapping.aspx

RE: global.asax issue

am 23.01.2008 17:53:01 von FabrizioCipriani

"Tem" wrote:

> I've been stuck on this error for days.
> I use global.asax to do url rewrite. which works fine on one server but not
> the other. they are both windows server 2003 R2 IIS6.
>
> if I do
> http://test.com/photo/123
> which would rewrite to http://test.com/photo/default.aspx?photo=123
>
> on the server that doesn't work, it gives me a 404 error
>
> but if I go and create a 123 folder under photo and a blank default.aspx, it
> would work and display the correct page.
> so this means global.asax is not being triggered
>
> There must be a setting somewhere
> Please help
>
> Tem

If your problem is to redirect extensionless urls, check
http://msmvps.com/blogs/omar/archive/2007/04/29/serve-extens ionless-url-from-asp-net-without-using-isapi-module-or-iis-6 -wildcard-mapping.aspx

Re: global.asax issue

am 23.01.2008 19:01:27 von Tem

It's works on our development server which is a fresh install of windows.
all default settings.
It does not work on the other server, our product server. but I did compare
the settings, didn't see anything different.
so strange

you are right about the asp.net engine not being called. that's why I worked
when I created an empty default.aspx file.

I thought global.asax is part of the application not just asp.net. I've
noticed that global.asax (using debug breakpoints with visual studio) gets
called even for files like javascript and jpg


"Alan Silver" wrote in message
news:xT81zmDSJ1lHFw4J@nospamthankyou.spam...
> In article <#DaR$UZXIHA.5880@TK2MSFTNGP04.phx.gbl>, Tem
> writes
>>I've been stuck on this error for days.
>>I use global.asax to do url rewrite. which works fine on one server but
>>not the other. they are both windows server 2003 R2 IIS6.
>
> OK, not sure why it works on one server, but I can tell you it's not
> working on the other ;-)
>
>>if I do
>>http://test.com/photo/123
>
> which doesn't have an .aspx ending, so the request will not be passed to
> the ASP.NET engine...
>
>>which would rewrite to http://test.com/photo/default.aspx?photo=123
>
> ...assuming it gets passed to ASP.NET, which it shouldn't. I am at a loss
> as to how this works on any machine, unless you've configured IIS to pass
> EVERY request to ASP.NET
>
>>on the server that doesn't work, it gives me a 404 error
>
> Correct, because IIS itself can't find such a folder.
>
>>but if I go and create a 123 folder under photo and a blank default.aspx,
>
> so the request now gets passed to ASP.NET
>
>>it would work and display the correct page.
>
> as ASP.NET processes the request, so the code in your global.asax is being
> given chance to run.
>
>>so this means global.asax is not being triggered
>
> No, because the request was not being passed to ASP.NET
>
>>There must be a setting somewhere
>
> Not quite, it's more a case of rethinking how you are going to do URL
> rewriting, unless you want to pass every single request through ASP.NET,
> which is a very good idea ;-)
>
>>Please help
>
> How about doing the rewriting like this...
>
> http://test.com/photo123.aspx
>
> which would rewrite to...
>
> http://test.com/photo/default.aspx?photo=123
>
> That would be fairly easy, and should work without problem.
>
> I know the idea of URL rewriting without any file endings would be nice,
> but it's not practical in most cases. This is one instance where
> mod_rewrite has some advantages over URL rewriting as it works at the
> server level, not at the script-processing level.
>
> HTH
>
> --
> Alan Silver
> (anything added below this line is nothing to do with me)

Re: global.asax issue

am 23.01.2008 19:01:27 von Tem

It's works on our development server which is a fresh install of windows.
all default settings.
It does not work on the other server, our product server. but I did compare
the settings, didn't see anything different.
so strange

you are right about the asp.net engine not being called. that's why I worked
when I created an empty default.aspx file.

I thought global.asax is part of the application not just asp.net. I've
noticed that global.asax (using debug breakpoints with visual studio) gets
called even for files like javascript and jpg


"Alan Silver" wrote in message
news:xT81zmDSJ1lHFw4J@nospamthankyou.spam...
> In article <#DaR$UZXIHA.5880@TK2MSFTNGP04.phx.gbl>, Tem
> writes
>>I've been stuck on this error for days.
>>I use global.asax to do url rewrite. which works fine on one server but
>>not the other. they are both windows server 2003 R2 IIS6.
>
> OK, not sure why it works on one server, but I can tell you it's not
> working on the other ;-)
>
>>if I do
>>http://test.com/photo/123
>
> which doesn't have an .aspx ending, so the request will not be passed to
> the ASP.NET engine...
>
>>which would rewrite to http://test.com/photo/default.aspx?photo=123
>
> ...assuming it gets passed to ASP.NET, which it shouldn't. I am at a loss
> as to how this works on any machine, unless you've configured IIS to pass
> EVERY request to ASP.NET
>
>>on the server that doesn't work, it gives me a 404 error
>
> Correct, because IIS itself can't find such a folder.
>
>>but if I go and create a 123 folder under photo and a blank default.aspx,
>
> so the request now gets passed to ASP.NET
>
>>it would work and display the correct page.
>
> as ASP.NET processes the request, so the code in your global.asax is being
> given chance to run.
>
>>so this means global.asax is not being triggered
>
> No, because the request was not being passed to ASP.NET
>
>>There must be a setting somewhere
>
> Not quite, it's more a case of rethinking how you are going to do URL
> rewriting, unless you want to pass every single request through ASP.NET,
> which is a very good idea ;-)
>
>>Please help
>
> How about doing the rewriting like this...
>
> http://test.com/photo123.aspx
>
> which would rewrite to...
>
> http://test.com/photo/default.aspx?photo=123
>
> That would be fairly easy, and should work without problem.
>
> I know the idea of URL rewriting without any file endings would be nice,
> but it's not practical in most cases. This is one instance where
> mod_rewrite has some advantages over URL rewriting as it works at the
> server level, not at the script-processing level.
>
> HTH
>
> --
> Alan Silver
> (anything added below this line is nothing to do with me)

Re: global.asax issue

am 23.01.2008 19:02:14 von Tem

"check file exists" is turn off for .aspx which is the default setting

"grava" wrote in message
news:B8195F87-A281-430E-B0E5-F22368600E60@microsoft.com...
>
>
> "Leon Mayne" wrote in message
> news:FA21A20A-D3A6-4E30-B598-349DF3E646DA@microsoft.com...
>> "Tem" wrote in message
>> news:%23DaR$UZXIHA.5880@TK2MSFTNGP04.phx.gbl...
>>> I've been stuck on this error for days.
>>> I use global.asax to do url rewrite. which works fine on one server but
>>> not the other. they are both windows server 2003 R2 IIS6.
>>>
>>> if I do
>>> http://test.com/photo/123
>>> which would rewrite to http://test.com/photo/default.aspx?photo=123
>>>
>>> on the server that doesn't work, it gives me a 404 error
>>>
>>> but if I go and create a 123 folder under photo and a blank
>>> default.aspx, it would work and display the correct page.
>>> so this means global.asax is not being triggered
>>>
>>> There must be a setting somewhere
>>> Please help
>>
>> Make sure the folder the global.asax is sitting in is configured as an
>> application in IIS, and that there is a web.config in the folder with it.
>
> Check IIS Configuration settings and check that IIS isn't checking for
> existence of the page!!!!
>
> I don't know how to do for a page without extension like yours, but if you
> map something like "123.do" and check the extension ".do" configuration in
> IIS -> Properties -> Applcation Configuration -> mappings ... you'll find
> a checkbox "Check that file exists" in your ".do" mapping configuration.
>
> HTH
>
>
> --
> Gianluca Gravina
> http://blogs.ugidotnet.org/thinkingingrava
>
>
>

Re: global.asax issue

am 23.01.2008 19:02:14 von Tem

"check file exists" is turn off for .aspx which is the default setting

"grava" wrote in message
news:B8195F87-A281-430E-B0E5-F22368600E60@microsoft.com...
>
>
> "Leon Mayne" wrote in message
> news:FA21A20A-D3A6-4E30-B598-349DF3E646DA@microsoft.com...
>> "Tem" wrote in message
>> news:%23DaR$UZXIHA.5880@TK2MSFTNGP04.phx.gbl...
>>> I've been stuck on this error for days.
>>> I use global.asax to do url rewrite. which works fine on one server but
>>> not the other. they are both windows server 2003 R2 IIS6.
>>>
>>> if I do
>>> http://test.com/photo/123
>>> which would rewrite to http://test.com/photo/default.aspx?photo=123
>>>
>>> on the server that doesn't work, it gives me a 404 error
>>>
>>> but if I go and create a 123 folder under photo and a blank
>>> default.aspx, it would work and display the correct page.
>>> so this means global.asax is not being triggered
>>>
>>> There must be a setting somewhere
>>> Please help
>>
>> Make sure the folder the global.asax is sitting in is configured as an
>> application in IIS, and that there is a web.config in the folder with it.
>
> Check IIS Configuration settings and check that IIS isn't checking for
> existence of the page!!!!
>
> I don't know how to do for a page without extension like yours, but if you
> map something like "123.do" and check the extension ".do" configuration in
> IIS -> Properties -> Applcation Configuration -> mappings ... you'll find
> a checkbox "Check that file exists" in your ".do" mapping configuration.
>
> HTH
>
>
> --
> Gianluca Gravina
> http://blogs.ugidotnet.org/thinkingingrava
>
>
>