x First time here? Check out the FAQ
  • Avatar526posts1116karma

    when the old pages are not from umbraco...

    Claushingebjerg started this topic February 17, 2010 @ 04:24

    It looks like a great package.

    Most of the sites we do, are convertions of sites from other systems, which means url naming can be different from site to site.

    On the one i'm trying to use your package on, the old files are alle named /default.aspx?id=48, with different numbers for each page.

    So if  i want to make "/default.aspx?id=48" go to the page i put the "umbraco301MovedPermanently" property onto.

    Will this work?

     

    And what about .php pages og static pages like .html and .htm?

    If it does, this could be a Favorite SUPERPACKAGE :)

    Thanks

     

     

     


  • Lee Kelleher posted this reply February 19, 2010 @ 09:03

    Hi Claushingebjerg,

    (Sorry for not getting back to you sooner - it's been a busy week here!)

    I've done a quick test with the various URLs.  A few things I found out...

    1. QueryString parameters don't get passed to the 404 NotFoundHandlers - only the URL path - so everything after the domain/slash up to the end of the file extension (if it has one).
    2. It will handle any file extension ... as long as IIS (or whatever your web-server) has mapped that extension to ASP.NET.

    So yes, any (non-Umbraco) .aspx pages and/or .php/.html/.whatever will work with this package.

    The only caveat is that because I based the development of this package on the "SearchForAlias" code, it strips out the ".aspx" before searching the 301 redirected.  So specifically for .aspx extensions ... remove the ".aspx" from the URL.

    Hope that helps? Let me know if you have any other questions!

    Cheers, Lee.


  • Benny Hung posted this reply June 9, 2010 @ 03:49

    I can't seem to get non-Umbraco pages to redirect correctly.  I would get a generic 404 error page.  I'm running IIS 7.5 in integration mode, and when a static file is requested, it seems like IIS's StaticFile handler would serve up the 404 error page.

    Is it a configuration setting I'm missing?

    Thanks

    -Benny


  • Lee Kelleher posted this reply June 9, 2010 @ 04:26

    Hi Benny, you'll need to pipe everything through ASP.NET for this to work.  There's a setting in the Web.config that should handle this for IIS7.

    <system.webServer>
        <modules runAllManagedModulesForAllRequests="true">

    Cheers, Lee.


  • Benny Hung posted this reply June 9, 2010 @ 06:16

    Hi Lee, thanks for the quick response.  I tried that setting and it's still not working.  Here's my <modules> and <handlers> sections from web.config:

    <system.webServer>
      <validation validateIntegratedModeConfiguration="false" />
      <modules runAllManagedModulesForAllRequests="true">
        <!-- Asp.net 3.5 Modules-->
        <remove name="ScriptModule" />
        <add name="ScriptModule" preCondition="managedHandler" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
        <!-- UMBRACO modules-->
        <add name="UrlRewriteModule" type="UrlRewritingNet.Web.UrlRewriteModule, UrlRewritingNet.UrlRewriter" />
        <add name="umbracoRequestModule" type="umbraco.presentation.requestModule" />
        <add name="viewstateMoverModule" type="umbraco.presentation.viewstateMoverModule" />
        <add name="umbracoBaseRequestModule" type="umbraco.presentation.umbracobase.requestModule" />
      </modules>
      <handlers>
        <!-- Asp.net 3.5 handlers-->
        <remove name="WebServiceHandlerFactory-Integrated" />
        <remove name="ScriptHandlerFactory" />
        <remove name="ScriptHandlerFactoryAppServices" />
        <remove name="ScriptResource" />
        <add name="SHTML" path="*.shtml" verb="*" modules="IsapiModule" scriptProcessor="C:\Windows\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll" resourceType="Unspecified" requireAccess="Script" preCondition="classicMode,runtimeVersionv2.0,bitness32" />
        <add name="ScriptHandlerFactory" verb="*" path="*.asmx" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
        <add name="ScriptHandlerFactoryAppServices" verb="*" path="*_AppService.axd" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
        <add name="ScriptResource" preCondition="integratedMode" verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
        <!-- UMBRACO Handlers -->
        <add verb="*" name="Channels" path="umbraco/channels.aspx" type="umbraco.presentation.channels.api, umbraco" />
        <add verb="*" name="Channels_Word" path="umbraco/channels/word.aspx" type="umbraco.presentation.channels.wordApi, umbraco" />
      </handlers>
    </system.webServer>

    Any ideas?


  • Lee Kelleher posted this reply June 9, 2010 @ 11:07

    Hi Benny, not too sure what other settings there are in IIS7.5 to handle the static files (or at least pipe them through ASP.NET).

    Unless anyone else knows how to fix this, I'd suggest googling around for "wildcard mappings in IIS7.5", see if you find anything useful?

    Once you've got that working, the 301 package should will handle those requests too.

    - Lee


  • Benny Hung posted this reply June 10, 2010 @ 09:04

    Thanks for the idea, I have already looked at wildcard mappings in IIS7.  And apparently ASP.NET is handling the static files.  It's just that for some reason, the 301 package doesn't get the static file requests.

    I set up one page that should be the destination.aspx page for /test.aspx, /test.shtml, /test.html, /test.txt.  Only the /test.aspx works.  The other 3 all show an IIS 404 error page.

    However, if I enable the "urlrewritingnet" component, then I can get test.shtml to redirect to destination.aspx.

    Can anyone think of a reason why might be?

     


  • Lee Kelleher posted this reply June 10, 2010 @ 09:10

    Not sure what the official name for it is in IIS7, but in IIS6 it was "Check if file exists".  See these pages:

    http://forums.iis.net/t/1092696.aspx

    http://blogs.iis.net/bills/archive/2007/05/25/tip-trick-how-to-turn-off-quot-verify-file-exists-quot-in-iis7.aspx

    Thinking that you've got the "Invoke handler only if request is mapped to file" setting enabled. The second link should help you out? I hope!

    Cheers, Lee.


  • Benny Hung posted this reply June 10, 2010 @ 09:40

    I don't think that's it.  Since I'm running in integrated pipeline mode, I didn't really create my own mapping for static files.  

    Just for fun, I did follow the steps in the 2nd link on the default Static File handler mapping that comes with IIS.  After that, the non-existent static files just return an empty page instead of 404, but the "301 package" handler code still did not kick in.

    Is it possible that Umbraco doesn't think that it should handle a static file request?  

    Actually, I just tried and it seems like test.asmx cannot be redirected  either.  This one returns an ASP.NET 404 page.


  • Avatar728posts884karma
    Comment with ID: 47623
    Connie DeCinko posted this reply September 22, 2010 @ 07:20

    I too am facing the same issues.  IIS 7.5, Umbraco 4.5.2, needing to process non aspx pages with a custom 404 redirect.  How do we get this working?

     


  • Avatar483posts899karma
    Comment with ID: 121143
    Laurence Gillian posted this reply July 2, 2012 @ 06:29

    Did anyone get any futher with this? All the best, Laurie


Please login or Sign up To post replies