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 ...I want to drop the I want to drop the 'www' prefix on the new dnn site
Previous
 
Next
New Post
5/12/2006 7:09 PM
 

I'm replacing an existing ASP site with a new DNN site, but I'd like the new site to force all URLs to drop the 'www' prefix.  There are lots of incoming links that include the 'www' and I'd like to strip it.  What's the easiest way to do this?

Right now, in IIS, I have the site configures to respond to both domain.com and www.domain.com, and I have DNN configured with portal aliases for both as well.

 
New Post
5/13/2006 3:49 PM
 

You could consider this one of the Good Practices for security, but I typically do not encourage the use of the default web site as many different microsoft products like to slap all kinds of services into the default web site folder that really should not be exposed to the Internet at large.

So I pretty much make a new web root, use host headers to identify what requests this root should respond to, leave the original default web site running with an unassigned IP and unspecified host header, but then deny access to the default from all IP's other than local IP's.

That aside, based on your specification, I think this is a workable solution. Also, let me be clear on what I interpret your specification to be. You want to take requests for www.domain.com and domain.com and then send them to a site that will serve domain.com. Correct?

First, you're going to need to configure DNN to only use the domain.com alias for the portal. You'll need to actually access the site's host account using the domain.com address. You can't delete an alias if that alias is the alias you are using to access the site at the point in time. Once in, remove the www.domain.com alias.

Second, if you block external access to your default web site (which again, I highly recommend), you'll quickly observe that anyone still requesting www.domain.com is going to get an error message. Ideally, what we'd like to do is instead use a redirection method to instead display the domain.com address.

You'll need to find out exactly what error is being displayed, and then go into web root's "Custom Errors" section and instead of pointing to the error file, point to a new file that will contain the redirection code. Something like this.

<%

Dim strRedirectURL As String

' Place code here to make strRedirectURL

Response.Redirect(strRedirectURL)

%>

Now all the requests will be sent to the error page of your choice and redirected to the domain.com address.

 

 
New Post
5/13/2006 5:39 PM
 

Excellent.

Since I posted originally, I'd already made some changes and it looks like I was on the right path.

Our server hosts dozens of sites, so I actually already had two independent web sites already configured in IIS.  The old ASP site now responds to www.domain.com, while the new DNN site responds to domin.com requests only.  I'd replaced the old site's default.asp page and it now simply redirects to domain.com.  I also removed the www.domain.com alias from the root DNN portal on the new site.

Based on your reponse, it looks like the only thing left to do is create a custom 404 page on the old site that examines the page request and looks it up in a simple table listing just OldUrl/NewUrl fields, then redirect the old page request to the corresponding page on the new DNN site.

I don't know why that didn't occur to me.

Thank you.

But now I have a slightly different question.  We're trying to simplify our marketing, and one of the things we're doing is publicize just root domains (domain.com) rather than the more traditional style (www.domain.com).

But on new DNN sites (not ones that replace an existing site), is there a simple way to force all page requests to strip any leading 'www' host prefixes?  Is this just a simple URL rewriter problem, or is there a better way?

 
Previous
 
Next
HomeHomeUsing DNN Platf...Using DNN Platf...Administration ...Administration ...I want to drop the I want to drop the 'www' prefix on the new dnn site


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