Redirecting to DNN

Discussion in 'Third-party applications' started by dma111, Apr 16, 2012.

Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.
  1. Web Gallery has installed DNN in a subfolder. I need to redirect the root to DNN. I replaced index.htm with only the following but I still get the default index.htm page displayed even after refreshing.

    <%Response.Redirect("/dotnetnuke/Default.aspx")%>

    How do I do the redirect?

    Thanks,
    Dave McMullen
     
  2. <%Response.Redirect("/dotnetnuke/Default.aspx")%>
    Did you put this on page event load?

    There are several ways to do redirection, one efficient way is by doing it in your web.config which means IIS will redirect HTTP request as soon as its received. Doesn't require page load meaning faster redirection.

    Web.config rule like this

    <system.webServer>
    <rewrite>
    <rules>
    <rule name="redirect" stopProcessing="true">
    <match url="^$" />
    <action type="RedirectToSubdir" url="/dotnetnuke" />
    </rule>
    </rules>
    </rewrite>
    </system.webServer>
     
  3. Still can't redirect

    I created a web.config in the root folder (see attached):

    web.config:
    <configuration>
    <system.webServer>
    <rewrite>
    <rules>
    <rule name="redirect" stopProcessing="true">
    <match url="^$" />
    <action type="RedirectToSubdir" url="/dotnetnuke" />
    </rule>
    </rules>
    </rewrite>
    </system.webServer>
    </configuration>

    My alternative URL still does not bring up DNN, even if I delete index.htm from the root. Try my alternative URL:

    http://bibleworlds.web703.discountasp.net

    index.htm only contains <%Response.Redirect("/dotnetnuke/Default.aspx")%>.

    I also tried index.htm with this:
    <%Response.Redirect("http://bibleworlds.web703.discountasp.net/dotnetnuke/Default.aspx")%> and no luck.

    Can you please give me code that works?

    Thanks
     

    Attached Files:

  4. Your web.config failed to parse because it was just part of it. I was just showing you the part that does redirection.

    See attached file, replace yours with this.
     

    Attached Files:

    • web.zip
      File size:
      344 bytes
      Views:
      432
  5. Still doesn't work:
    <?xml version="1.0" encoding="UTF-8"?>
    <configuration>
    <system.webServer>
    <rewrite>
    <rules>
    <rule name="redirect" stopProcessing="true">
    <match url="^$" />
    <action type="RedirectToSubdir" url="/dotnetnuke" />
    </rule>
    </rules>
    </rewrite>
    </system.webServer>
    </configuration>

    Does it work for you? I even deleted the index.htm file and it still comes up.
     
  6. Not on my machine -- I get Welcome to DiscountASP.net -- not DotNetNuke.
     
  7. RayH

    RayH DiscountASP.NET Lackey DiscountASP.NET Staff

    Information may be cached. Try refreshing your browser.
     
  8. Multiple HTML Redirects to DNN .aspx pages

    Question, I saw this post and i'm having the same issue.

    I've got an old html site that i've converted to a DNN site...
    There are about 8 html pages i need to redirect to my new aspx pages.

    Using this sample, how could i match multiple html pages to redirect to the appropriate new DNN aspx page.

    For example
    I have www.mydomain.com/mypage01.html, www.mydomain.com/mypage02.html, and www.mydomain.com/mypage03.html

    Using your example would the code for this section in my web.config look like this?
    Code:
    <configuration>
        <system.webServer>
            <rewrite>
                <rules>
                    <rule name="redirect" stopProcessing="true">
                        <match url="mypage01.html" />
                        <action type="Redirect" url="mypage01.aspx" />
                    </rule>
                </rules>
            </rewrite>
    	<rewrite>
                <rules>
                    <rule name="redirect" stopProcessing="true">
                        <match url="mypage02.html" />
                        <action type="Redirect" url="mypage01.aspx" />
                    </rule>
                </rules>
            </rewrite>
    	<rewrite>
                <rules>
                    <rule name="redirect" stopProcessing="true">
                        <match url="mypage03.html" />
                        <action type="Redirect" url="mypage03.aspx" />
                    </rule>
                </rules>
            </rewrite>
        </system.webServer>
    </configuration>
    Note: Of course above code of mypage03.aspx and etc. will be a friendly URL that i've updated the TABID to read as page name .aspx

    In view of the foregoing, will this work by updating my web.config as shown above to catch multiple old .html files that need to be redirected to my new dnn .aspx pages?

    Please advise as soon as you can. Thanks

    P.S. I know there is module that will do this but i'm on a tight budget so i need to configure the web config to make old html redirects to my new dnn .aspx files. Again, please advise..
     
  9. Multiple HTML Redirects to DNN .aspx pages

    I saw this post and i'm having the same issue.

    I've got an old html site that i've converted to a DNN site...
    There are about 8 html pages i need to redirect to my new aspx pages.

    Using this sample, how could i match multiple html pages to redirect to the appropriate new DNN aspx page.

    For example
    I have www.mydomain.com/mypage01.html, www.mydomain.com/mypage02.html, and www.mydomain.com/mypage03.html

    Using your example would the code for this section in my web.config look like this?
    Code:
    <configuration>
        <system.webServer>
            <rewrite>
                <rules>
                    <rule name="redirect" stopProcessing="true">
                        <match url="mypage01.html" />
                        <action type="Redirect" url="mypage01.aspx" />
                    </rule>
                </rules>
            </rewrite>
    	<rewrite>
                <rules>
                    <rule name="redirect" stopProcessing="true">
                        <match url="mypage02.html" />
                        <action type="Redirect" url="mypage01.aspx" />
                    </rule>
                </rules>
            </rewrite>
    	<rewrite>
                <rules>
                    <rule name="redirect" stopProcessing="true">
                        <match url="mypage03.html" />
                        <action type="Redirect" url="mypage03.aspx" />
                    </rule>
                </rules>
            </rewrite>
        </system.webServer>
    </configuration>
    Note: Of course above code of mypage03.aspx and etc. will be a friendly URL that i've updated the TABID to read as page

    name .aspx

    In view of the forgoing, will this work by updating my web.config as shown above to catch multiple old .html files that

    need to be redirected to my new dnn .aspx pages?

    Please advise as soon as you can. Thanks

    P.S. I know there is module that will do this but i'm on a tight budget so i need to configure the web config to make old

    html redirects to my new dnn .aspx files. Again, please advise..
     
Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.

Share This Page