www versus non www

Discussion in 'Server Operation' started by jopa123, Mar 22, 2011.

  1. jopa123

    jopa123 New Member

  2. astinsan

    astinsan New Member

    Are you asking how to setup an alias in your apache server (if that is your httpd) or are you asking howto setup a cname?
  3. jopa123

    jopa123 New Member

    I really don't know. I guess that's what I'm asking, what is the proper way to make the site resolve to the www address when it is clicked on from some outside link. Do I do this via cname or via an alias?

    Apache is my server.

  4. astinsan

    astinsan New Member

    You can use rewrite Here is an example that I found at http://www.thesitewizard.com/apache/redirect-domain-www-subdomain.shtml
    How to Automatically Add the "www" Prefix to Your Domain Names in URLs
    To redirect (say) example.com to www.example.com, add the following code to your .htaccess file.
    RewriteEngine on
    RewriteCond %{HTTP_HOST} ^example\.com$ [NC]
    RewriteRule ^(.*)$ http://www.example.com/$1 [R=301,L]
    The above code causes the server to check that the domain name portion of the URL is example.com. If it is, the visitor will be sent to www.example.com instead. 
    Hope this helps...
  5. jopa123

    jopa123 New Member

    Thanks, Astinsan.

    Do I need to add this code for each and every domain? I was hoping that there was a setting in ISPConfig that could handle this for me but if not this will work.

    Thanks again
  6. falko

    falko Super Moderator ISPConfig Developer

    Yes, you must do this for every domain.
  7. astinsan

    astinsan New Member

    Yes but there should be a way to set default options for new accounts. Most scripts do this. I am not familiar with ispconfig but I am sure there has to be a way.
  8. jopa123

    jopa123 New Member

    I thought the "auto subdomain" field in ISPConfig might would be the way, but I have set each of my sites to the "www" option in the auto subdomain field and it does not accomplish what I am trying to do.

    Thanks for the help, tho, guys.
  9. falko

    falko Super Moderator ISPConfig Developer

    From the ISPConfig 3 Manual:

  10. xciso

    xciso Member

    I have checked the box but my site dont show the www before my domain.
    Do i have to make a subdomain or a cname for www?

    I thought the checkbox is for this thing.
  11. falko

    falko Super Moderator ISPConfig Developer

    Does the www DNS record point to the correct server?

    Is it possible you have a rewrite rule that redirects www tp the non-www site?

Share This Page