DNN Forums

Ask questions about your website to get help learning DNN and help resolve issues.

What is the best way to set up a redirect in DNN

Sort:
You are not authorized to post a reply.





Advanced Member





    Hi - What is the best way in DNN to set up a redirect so that any time someone browses to (for example) "http://www.mywebsite.com/..." they get redirected to "http://www.mywebsite.us/.." ?

    Thanks

    Tom






    Veteran Member





      I guess you have 3 choices:
      1. a page can have a setting (page settings) to be a redirect
      2. there is the ability to use a SEO module like https://www.40fingers.net...cts/DNN-SEO-Redirect (free, open source)
      3. you can work your magic in the web.config: https://dnncommunity.org/...-of-redirects-in-DNN
      Tjep's digital agencyRegards,
      Tycho de Waard

      Tjep's digital agency
      We just love DNN
      https://www.tjeps.com





      Growing Member





        ...and a fourth option. Don't redirect. You can use a portal alias to have the same content exposed under BOTH top level names.
        Thanks,
        Richard
        www.dynamisys.co.uk





        Advanced Member





          Thanks for your replies -

          I am trying to do this in the web.config (on a test website), but when I add the [rewrite] tag, it breaks the website. I dont have any [httpProtocol] tag in my web.config. Does the [rewrite] tag need to go inside the [system.webServer] tag?

          Thanks






          Veteran Member





            Yes, inside system.webserver.
             

            Tjep's digital agencyRegards,
            Tycho de Waard

            Tjep's digital agency
            We just love DNN
            https://www.tjeps.com





            Veteran Member





              I'll email a bit more for comprehension.
              Tjep's digital agencyRegards,
              Tycho de Waard

              Tjep's digital agency
              We just love DNN
              https://www.tjeps.com





              Advanced Member





                Thanks Tycho - but I can't see any of you examples in your message

                I appreciate your help with this

                Tom






                Veteran Member





                  Yeah, the forum strips out some stuff. I emailed to your gmail-account.
                  Tjep's digital agencyRegards,
                  Tycho de Waard

                  Tjep's digital agency
                  We just love DNN
                  https://www.tjeps.com





                  Veteran Member





                    Posted By Tom Melkonian on 16 Jun 2020 12:49 PM

                    Thanks for your replies -

                    I am trying to do this in the web.config (on a test website), but when I add the [rewrite] tag, it breaks the website. I dont have any [httpProtocol] tag in my web.config. Does the [rewrite] tag need to go inside the [system.webServer] tag?

                    Thanks

                    Please note that you must first install the Url Rwriter module or these lines will crash your site.
                    https://www.iis.net/downl...icrosoft/url-rewrite

                    BTW, the DNN (IMO best) way of doing this would be to use Multiple Portal Aliasses (as Richard Mentioned).

                    URL rewriter is mostly used for http > https redirects.
                    Example:

                     

                    < rewrite>
                          < rules>
                            < rule name="HTTP to HTTPS redirect" stopProcessing="true">
                              < match url="(.*)" />
                              < conditions>
                                < add input="{HTTPS}" pattern="off" ignoreCase="true" />
                              < /conditions>
                              < action type="Redirect" url="https://{HTTP_HOST}/{R:1}" redirectType="Permanent" />
                            < /rule>
                          < /rules>
                         
                        < /rewrite>






                    Growing Member





                      One more option possibly. If the site is hosted in a Plesk environment, Plesk allows for multiple domain aliases and will redirect traffic to your preferred alias.
                      You are not authorized to post a reply.

                      These Forums are dedicated to the discussion of DNN Platform.

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

                      1. If you have (suspected) security issues, please DO NOT post them in the forums but instead follow the official DNN security policy
                      2. No Advertising. This includes the promotion of commercial and non-commercial products or services which are not directly related to DNN.
                      3. 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.
                      4. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
                      5. No Flaming or Trolling.
                      6. No Profanity, Racism, or Prejudice.
                      7. Site Moderators have the final word on approving / removing a thread or post or comment.
                      8. English language posting only, please.

                      Would you like to help us?

                      Awesome! Simply post in the forums using the link below and we'll get you started.

                      Get Involved