0
votes

I try to redirect www.myDNNSite.com/hastinfo/[...] to http://172.16.244.43:83/[...] in DNN 7.x

To do that, I added a rule in SiteUrls.config as this blog showed https://bertcraven.wordpress.com/2008/05/21/quick-n-dirty-redirects-in-dotnetnuke/

<RewriterRule>
     <LookFor>[^?]*/hastinfo/(.*)</LookFor>
     <SendTo>http://172.16.244.43:83/$1</SendTo>
</RewriterRule>

This not work if there is a . after hastinfo, so:

  • www.myDNNSite.com/hastinfo/test -> OK 172.16.244.43:83/test
  • www.myDNNSite.com/hastinfo/myhandler.axd -> KO error 404 and no redirection

It seems that DNN make something with URL if there is a . founded.

How to make my redirection working even if a . (dot) is present in url ?

EDIT:

My objective with this redirection is to have the same end point for my dev and production environment. I have three server on the front end and the Web Service behind the www.myDNNSite.com/hastinfo point to three differents servers to load balance the charge. Before update to DNN 7.X, I was using ManagedFusionRewriter that make the job.

But It is not updated from 2009 and now with IIS 8.5 I look a better way to make this redirection from a config file.

EDIT 2:

I try to add IIS Mod Rewrite in my IIS 8.5 and write in Web.config:

<rewrite>      
  <rules>
  <rule name="Imported Rule 101" stopProcessing="true">
    <match url="^hastinfo/(.*)" />
     <action type="Rewrite" url="http://172.16.244.43:83/{R:1}" appendQueryString="true" />
  </rule>

Without success ... here the Failed Tracing:

enter image description here

2

2 Answers

0
votes

Using IIS Redirects in combination with the DNN Friendly Url providers is often a recipe for disaster sadly.

In this case, the reason that you are having issues more than likely is that the .axd is being captured by the ASP.NET process and that is preventing the re-writing from happening.

Based on what you are looking to do, can you explain a bit the true goal? The reason for this answer rather than a "do this" is that redirecting with DNN to a non-standard port is also going to cause issues as there is a setting for "usePortNumber" in the web.config that you will want to have on if using a non-standard port.

0
votes

I finally found a way to make it works.

Thanks to: http://blogs.msdn.com/b/asiatech/archive/2011/08/25/return-404-4-not-found-when-url-rewrite.aspx

You need to install Application Request Routing and enable Proxy, then it will work with URL rewriting to remote servers (regardless where or what they are) since the Routing will take care of that.

http://www.iis.net/download/ApplicationRequestRouting