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 ...Redirect Errors from Google AnalyticsRedirect Errors from Google Analytics
Previous
 
Next
New Post
11/7/2014 12:31 PM
 
Hello everyone! I am getting errors from Google Analytics, www.domainname.com is receiving data from redundant hostnames. Is there a way within DNN to redirect http://domainname.com to www.domainname.com? I've set up the canonical URL under site settings to be the WWW, but for some reason google is reporting both as separate data. 




 
New Post
11/7/2014 3:49 PM
 
Hi Everyone-

I've figured out an easy way to do this for anyone curious about the same issue- I've pasted it below

All Versions of DotNetNuke

1.Connect to your site's web.config file.

2. Scroll down until you find the <system.webserver> or line and just below it, press enter to add a new line.

3. Paste the following code at the new line:
<rewrite>
  <rules>
   <clear />
    <rule name="WWW Rewrite" enabled="true">
      <match url="(.*)" />
        <conditions>
          <add input="{HTTP_HOST}" negate="true" pattern="^www\.(.*)$" />
        conditions>
        <action type="Redirect" url="http://www.{HTTP_HOST}/{R:0}" appendQueryString="true" redirectType="Permanent" />
    rule>
  rules>
rewrite>

4. Save the web.config.
 
New Post
11/9/2014 9:03 AM
 
you usually don't need to manipulate web.config manually for this, just add both domain addresses as Aliases in Admin > Site Settings (2nd tab), set the preferred one to default and enable redirect mode.

Cheers from Germany,
Sebastian Leupold (Microsoft MVP)

dnnWerk - The DotNetNuke Experts   German Spoken DotNetNuke User Group

Speed up your DNN Websites with TurboDNN
 
Previous
 
Next
HomeHomeUsing DNN Platf...Using DNN Platf...Administration ...Administration ...Redirect Errors from Google AnalyticsRedirect Errors from Google Analytics


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.

Content Layout

Subscribe to DNN Digest

Subscribe to DNN Digest

DNN Digest is our monthly email newsletter. It highlights news and content from around the DNN ecosystem, such as new modules and themes, messages from leadership, blog posts and notable tweets. Keep your finger on the pulse of the ecosystem by subscribing.  


Copyright 2017 by DNN Corp Terms of Use Privacy
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out