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

 9 Replies
 3 Subscribed to this topic
 40 Subscribed to this forum
Sort:
Author
Messages
Advanced Member
Posts: 228
Advanced Member
New Poster
New Poster
Congrats on posting!

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
Posts: 838
Veteran Member
3 Helpful Replier
Helpful Replier
Thanks for being such a helpful replier!
New Poster
New Poster
Congrats on posting!
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
Growing Member
Posts: 51
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.
Advanced Member
Posts: 228
Advanced Member
New Poster
New Poster
Congrats on posting!

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
Posts: 838
Veteran Member
3 Helpful Replier
Helpful Replier
Thanks for being such a helpful replier!
New Poster
New Poster
Congrats on posting!

Yes, inside system.webserver.
 

Veteran Member
Posts: 838
Veteran Member
3 Helpful Replier
Helpful Replier
Thanks for being such a helpful replier!
New Poster
New Poster
Congrats on posting!
I'll email a bit more for comprehension.
Advanced Member
Posts: 228
Advanced Member
New Poster
New Poster
Congrats on posting!

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

I appreciate your help with this

Tom

Veteran Member
Posts: 838
Veteran Member
3 Helpful Replier
Helpful Replier
Thanks for being such a helpful replier!
New Poster
New Poster
Congrats on posting!
Yeah, the forum strips out some stuff. I emailed to your gmail-account.
Senior Member
Posts: 1322
Senior Member
3 Helpful Replier
Helpful Replier
Thanks for being such a helpful replier!
Lifesaver
Lifesaver
You're Life Saver!
New Poster
New Poster
Congrats on posting!
3 Engaged Reader
Engaged Reader
You are an engaged reader!
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
Posts: 80
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.

These Forums are for the discussion of the open source CMS DNN platform and ecosystem.

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