Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeUsing DNN Platf...Using DNN Platf...Administration ...Administration ...Trying to redirect certain domain names to ASP app/DNN installed in my hosting routeTrying to redirect certain domain names to ASP app/DNN installed in my hosting route
Previous
 
Next
New Post
6/25/2006 7:51 AM
 

I have DNN installed in my hosting route and I am also trying to redirect certain domain names to ASP application subdirectories.

I am having an issue with my host provider and running DNN in an ASP.NET 2.0 Application subdirectory.  I have been  getting intermittent errors relating to security policy.  After searching everywhere I found a few people in this forum have been having similar problems with hosting companies running apps in medium trust level.

I have tried to get help from the hosting company but getting nowhere....Rather than try and get anything changed with my host (they are mainly a bunch of furstrating idiots),  I have moved all my DNN installation to the root as I have heard this may solve the issues.  And during brief tests it appears to be working without the errors.

However in the scenario where I run any ASP .NET 2.0 apps the Host provider asks users to use a default.asp file to redirect the targettted web site to another directory.  This can be handled by DNN for DNN sites.  However the problem lies in the fact that I am also hosting several ASP (not .NET) sites on this hosting account and for those domains I need to redirect to a subdirectory.   I can't use a default.asp file as the default.aspx takes precendence on the server.  I have tried to rename the default.aspx and use default.asp code to redirect to it, while this works in the intital sense it breaks how DNN works and the DNN sites fail to load with errors.

With my limited understanding of ASP.NET and DNN (using the 4.3.1 RC at moment) I have tried to hack the code in the default.aspx.vb file with no luck.

I inserted this code in the default.aspx.vb file (in several places) without success.  I have included this code just so you can see what I am trying to acheive.

Private Sub InitializePage()

'++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
            '++  REDIRECT TO OTHER NON DNN WEBSITES - ROD DINES - 23 JUNE 2006
            '++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
            Dim redirect_host As String = lcase(Request.ServerVariables("HTTP_HOST"))
            Dim redirect_weburl As String = ""

            ' redirect to a site url not within DotNetNuke
            select case replace(redirect_host,"www.","")

            case "mydomain.co.uk","mydomain.com"
  redirect_weburl="http://" & redirect_host & "/mydirectory_on_mydomain/default.asp"
            end select

            if redirect_weburl <> "" then
  Response.Redirect(redirect_weburl, True)
            end if
            '++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

I have also tried to use the friendlyURL process with no luck.  Here is an excerpt of the changes I made to config/SiteURLS.config to attempt to do this.  However the documentation on using this does not include any syntax help (or I cant find it).  And I'm not sure it is even capable of doing what I need.

 <RewriterRule>
   <LookFor>*mydomain.com</LookFor>
   <SendTo>~/mydirectory_on_mydomain/default.asp</SendTo>
  </RewriterRule>

PLEASE!  I would greatley appreciate it if anyone who understands how DNN 4.3.1 works, can please point me in the right direction to either implement a configuration change or to HACK the source code.  Please let me know specifically where in the source I should insert the above code and if need be how I should adapt it.

Thanks, Rod.

 
New Post
6/25/2006 4:32 PM
 

Redirecting fiend at your service!

I think the answer to your problem is simple, you're putting the code in the wrong place. soandso.aspx.vb files are where one would put code if you plan on completely recompiling the source for your site. It'll then be placed into the DLL's, and it'll probably work.

However, if you aren't performing a new compile, this change will do nothing. You need to insert this code "in-line" into the actual default.aspx file, and then you'll be good to go.

 
New Post
6/25/2006 9:50 PM
 

Hi Casey:

I greatley appreciate your response, however I thought I tried that before...Anyways I tried again using the code below in several places in default.aspx (itself) and non-worked.

I somehow think that DNN is doing some class trickery here that is not easy to undertsand without some thorough knowledge of its structure and how ASP .NET 2.0 works.

Please HELP anyone else willing to give it a go!

Thanks for the try, Rod. 

<%
'++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
'++  REDIRECT TO OTHER NON DNN WEBSITES - ROD DINES - 23 JUNE 2006
'++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

 Dim redirect_host As String = lcase(Request.ServerVariables("HTTP_HOST"))
 Dim redirect_weburl As String = ""

 ' redirect to a site url not within DotNetNuke
 select case replace(redirect_host,"www.","")
 case "mydomain.co.uk","mydomain.com"
  redirect_weburl="http://" & redirect_host & "/mydirectory_on_mydomain/default.asp"
 end select

 if redirect_weburl <> "" then
  Response.Redirect(redirect_weburl, True)
 end if

'++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
%>

 
Previous
 
Next
HomeHomeUsing DNN Platf...Using DNN Platf...Administration ...Administration ...Trying to redirect certain domain names to ASP app/DNN installed in my hosting routeTrying to redirect certain domain names to ASP app/DNN installed in my hosting route


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out