Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Zac 238 posts 539 karma points
    Aug 27, 2014 @ 02:54
    Zac
    0

    301 redirects for non-aspx extensions (html, php, asp)

    I'm using v3 of the Url Tracker and trying to redirect html and php pages on u7.1.6.

    The url tracker is working great for .net extensionless and .aspx pages, but we can't get it to handle html or php requests.

    I'm guessing this is just a web.config setting but we haven't had any luck screwing around with the settings.

    The two settings that I thought would take care of this (to no avail) are set as

        <modules runAllManagedModulesForAllRequests="true"> (but it doesn't look like there's an iis module for the 301 tracker?)

    and httpErrors existingResponse="PassThrough" 

     

    I was hoping that you might have a quick answer to help me out.

    Note that we are running in Integrated Pipeline mode.

    Thanks for your help!

    Zac

     

  • Stefan Kip 1606 posts 4098 karma points c-trib
    Aug 27, 2014 @ 13:56
    Stefan Kip
    0

    It should work with runAllManagedModulesForAllRequests set to true.
    The UrlTracker does run via an HttpModule, but it's not mentioned in the web.config (programmatically registered with C#).
    The only way to find out what's going on is to enable the UrlTracker's logging (see the readme for instructions).

  • Zac 238 posts 539 karma points
    Sep 03, 2014 @ 21:33
    Zac
    0

    Thanks for the reply.

    I tried to enable debug mode but think I may have missed something as I'm not really seeing UrlTracker logs.

    I updated the appsettings with the following entries

        <add key="urlTracker:enableLogging" value="true" /> and 

        <add key="umbracoDebugMode" value="true" />  <!-- I don't think this is being used in v7... should there be a different setting?  compilation debug is set to true -->

    and viewed the /App_Data/Logs/UmbracoTraceLog.txt log file, but don't see any UrlTracker related logs.

    I hit urls that are being handled by the 301 UrlTracker (and others that aren't) and no logs seem to be added.  

    Any suggestions?

  • Stefan Kip 1606 posts 4098 karma points c-trib
    Sep 04, 2014 @ 09:14
    Stefan Kip
    0

    That's weird, there should be entries...
    Can you check the 'config\log4net.config' file to see if the 'AsynchronousLog4NetAppender' has the levelMin filter value set to 'INFO'? Like this:

    <appender name="AsynchronousLog4NetAppender" type="Umbraco.Core.Logging.AsynchronousRollingFileAppender, Umbraco.Core">
      <filter type="log4net.Filter.LevelRangeFilter">
        <acceptOnMatch value="true" />
    --> <levelMin value="INFO" />
        <levelMax value="FATAL" />
      </filter>
      <file value="App_Data\Logs\UmbracoTraceLog.txt" />
      <lockingModel type="log4net.Appender.FileAppender+MinimalLock" />
      <appendToFile value="true" />
      <rollingStyle value="Date" />
      <maximumFileSize value="5MB" />
      <layout type="log4net.Layout.PatternLayout">
      <conversionPattern value="%date [%thread] %-5level %logger - %message%newline" />
    </layout>
    </appender>
    
  • Kenny Burns 173 posts 304 karma points
    Nov 21, 2014 @ 12:11
    Kenny Burns
    1

    Hello,

    We had this issue also but came across this blog post which seems to have sorted it (for asp pages at least)

    http://amdonnelly.blogspot.co.uk/2011/02/301-redirects-for-html-files-in-umbraco.html

    We added a handler mapping on our website in IIS (7):
    Request Path: *.asp
    Type: umbraco.BasePages.BasePage

    Hope that might be of some help!

    Cheers,

    Kenny

  • Stefan Kip 1606 posts 4098 karma points c-trib
    Nov 21, 2014 @ 13:58
    Stefan Kip
    0

    That's weird, AFAIK an HttpModule is executed for every single request, no matter what mappings are configured.

  • Zac 238 posts 539 karma points
    Nov 21, 2014 @ 17:00
    Zac
    0

    Thanks Kenny - this is awesome!

    We fixed the mappings by adding the following to the handlers web.config section.  Now this package works great for html, php and asp extensions.

          <add name="UmbracoBaseMappingHtml" path="*.html" verb="*" type="umbraco.BasePages.BasePage" resourceType="Unspecified" preCondition="integratedMode" />
         <add name="UmbracoBaseMappingPhp" path="*.php" verb="*" type="umbraco.BasePages.BasePage" resourceType="Unspecified" preCondition="integratedMode" />

         <add name="UmbracoBaseMappingAsp" path="*.asp" verb="*" type="umbraco.BasePages.BasePage" resourceType="Unspecified" preCondition="integratedMode" />

  • Stefan Kip 1606 posts 4098 karma points c-trib
    Nov 21, 2014 @ 17:37
    Stefan Kip
    0

    It works for me OOTB, just saying...

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies