Results 1 to 12 of 12
  1. #1
    Join Date
    Mar 2002
    Posts
    238

    How to make domain.com jump to www.domain.com?

    With Plesk, there is a "www" option which will automatically convert all http://domain.com/ requests to http://www.domain.com/

    So http://domain.com/folder/page.html would auto-convert to http://www.domain.com/folder/page.html

    How do I do this for sites not hosted on Plesk? Is Plesk doing this through a DNS record, or something else?

  2. #2
    add www record.

  3. #3
    Well, Yup, you are right about the DNS record thing.

    You will need an Cname entry to achieve that.

    Here is the URL which contains more information :
    http://www.rscott.org/dns/cname.html
    http://www.batchimage.com - Offering Batch Image Processing and TIFF/PDF Software Solutions

  4. #4
    You could use an A record as well

  5. #5
    Join Date
    Jan 2002
    Location
    Scotland, UK
    Posts
    2,687
    The record should look something like this:
    www 14400 IN CNAME domain.com.
    The TTL (14400) may vary. Also please note the trailing "." after domain.com. Obviously replace "domain.com" with the domain name
    Chris Adams - CEO - Rochen Ltd. - chris (at) rochen (dot) com

    Now offering both US & UK premium business hosting, reseller hosting and managed virtualized services.
    rochen.com | rochen.co.uk | blog.rochen.com | forums.rochen.com | Twitter: @rochenhost

  6. #6
    Join Date
    Apr 2002
    Location
    USA
    Posts
    5,779
    Huh?
    If I am reading the question right you are wanting add an alias file so the web site can be called by www.domain.com or domain.com either one. If I am assuming correctly, all you have to do is add Serveralias www.domain.com domain.com to the VitrualHost directive for that domain.

  7. #7
    Join Date
    Jan 2002
    Location
    Scotland, UK
    Posts
    2,687
    Monte - That's how I read it at first, however after reading it again, I didn't really see the point in making www go to non-www, since they are most likely going to be the same thing. So I thought kreativ was asking how to add www. Anyway, whatever the question may be I think it is covered in one of the posts here heh
    Chris Adams - CEO - Rochen Ltd. - chris (at) rochen (dot) com

    Now offering both US & UK premium business hosting, reseller hosting and managed virtualized services.
    rochen.com | rochen.co.uk | blog.rochen.com | forums.rochen.com | Twitter: @rochenhost

  8. #8
    Join Date
    Mar 2002
    Posts
    238
    I thought "www.domain.com IN CNAME domain.com" simply allows someone to type in www.domain.com without getting a server not found message. (i.e. it's just an alias for domain.com). How would this convert http://domain.com/page.html to http://www.domain.com/page.html?

  9. #9
    Join Date
    Mar 2002
    Posts
    238
    Oops, I probably wasn't very clear in my original post. I'm assuming the www CNAME is already present. Otherwise, no one could access the site through www.domain.com.

    What I meant was, Plesk has an option in the control panel where if a visitor accesses the site by typing in "http://domain.com/page.html", the URL is automatically changed for them to "http://www.domain.com/page.html"

    I'd like to know the most efficient way to do that on a non-Plesk site (Ensim, CPanel, etc.)
    Am I making any sense?

  10. #10
    Join Date
    Nov 2000
    Location
    Moran, Ks
    Posts
    186

    Re: How to make domain.com jump to www.domain.com?

    Originally posted by kreativ
    With Plesk, there is a "www" option which will automatically convert all http://domain.com/ requests to http://www.domain.com/

    So http://domain.com/folder/page.html would auto-convert to http://www.domain.com/folder/page.html

    How do I do this for sites not hosted on Plesk? Is Plesk doing this through a DNS record, or something else?

    As has already been mentioned, you will need either a CNAME or an A record in the DNS for the www for it to resolve, this will not "auto convert" http://domain.com/folder/page.html to http://www.domain.com/folder/page.html though. To get that to happen (if you really need it), you are going to need to rewrite the URL, which , with the apache webserver is done using mod_rewrite. If you have mod_rewrite available in your apache server, you can put lines similar to the following in either the server config file, or in .htaccess files....

    RewriteEngine On
    RewriteCond %{HTTP_HOST} ^mydomain\.com [NC]
    RewriteRule ^/(.*) "http://www.mydomain.com/$1" [L,R]

    Of course, this needs to be in the appropriate part of the configuration file or file system so that it will be activated by requests to http://mydomain.com....

  11. #11
    Join Date
    Apr 2002
    Location
    USA
    Posts
    5,779
    I guess I am still confused

    For instance you can address all the sites on my server http://domain.com or http://www.domain com it does not matter. Are you saying you want make it change in the address bar to www. domain.com if they type just domain.com? If so I have no idea and I am backing out of this post, before I make a fool of myself.

  12. #12
    Join Date
    Mar 2002
    Posts
    238
    Originally posted by Monte
    I guess I am still confused

    For instance you can address all the sites on my server http://domain.com or http://www.domain com it does not matter. Are you saying you want make it change in the address bar to www. domain.com if they type just domain.com? If so I have no idea and I am backing out of this post, before I make a fool of myself.
    Yes, that's what I was trying to get at in my porrly worded post. Thanks for the better wording.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •