www part of the url

edited May 2007 in Science & Tech
hi, just wondering how can i get my domain to display the www bit of the url if i enter http://mydomain.com ... i seen alot of site when you type in http://domain.com the page loads and the url changes to http://www.domain.com

like i always type in http://google.com and when the forum home page loads, it changes to http://www.google.com

Comments

  • Your-Amish-DaddyYour-Amish-Daddy The heart of Texas
    edited May 2007
    I think it has to do with the domain registration or something, since "www" sites don't always lead to webservers, and non-marked sites often lead to webservers. Send your domain register an email and ask about it.
  • LincLinc Owner Detroit Icrontian
    edited May 2007
    That's to do with the server's setup. Some people use something like Apache's mod_rewrite to require a "canonical" address - it always either adds or takes away the www. I plan on implementing this soon on Short-Media (to always remove the www).

    This is something you'll need to discuss with your hosting provider. My guess is that it will be more trouble than it's worth unless you host it yourself.
  • KwitkoKwitko Sheriff of Banning (Retired) By the thing near the stuff Icrontian
    edited May 2007
    I plan on implementing this soon on Short-Media (to always remove the www).

    Why?
  • LincLinc Owner Detroit Icrontian
    edited May 2007
    Because I'm tired of people leaving links with/without the www when I'm cookied on the other one. That, and it's just extraneous typing. URLs should be as compact and semantic as possible. :)
  • ZuntarZuntar North Carolina Icrontian
    edited May 2007
    the www part is useless now-a-days, IMHO.
  • yaggayagga Havn't you heard? ... New
    edited May 2007
    Zuntar wrote: »
    the www part is useless now-a-days, IMHO.

    yes, seems reasonable
  • RobRob Detroit, MI
    edited May 2007
    At one point, 'domains' were just that, your companies domain. The www. is a third level domain, which was directed to the world wide web portal for a companies 'domain' Computers really did exist before porn sites and broadband, really....

    The lines are muddy now. www. is a third level domain, but since it has such a close relationship to the domain these days they are usually aliased in the server configuration and DNS.

    You will still see some companies web sites only respond to www.
  • Your-Amish-DaddyYour-Amish-Daddy The heart of Texas
    edited May 2007
    Thanks for the info, Rob.
  • LincLinc Owner Detroit Icrontian
    edited May 2007
    Good to see you, Rob!
  • RobRob Detroit, MI
    edited May 2007
    Yeah, I still lurk from time to time :)
  • edited May 2007
    got it fixed with this into my .htaccess file
    RewriteEngine on

    #Define Rewrite Base.

    RewriteBase /

    RewriteCond %{QUERY_STRING} ^$

    RewriteRule ^index\.php$ / [R=301,L]

    Options +FollowSymLinks

    RewriteCond %{HTTP_HOST} ^cokenut\.net [NC]

    RewriteRule ^(.*)$ http://www.cokenut.net/$1 [L,R=301]

    RewriteCond %{THE_REQUEST} (index\.php) [NC]

    RewriteRule ^(.*)index\.php$ http://www.cokenut.net/$1 [L,R=301]

    cheers guys...
  • Your-Amish-DaddyYour-Amish-Daddy The heart of Texas
    edited May 2007
    Thanks for the code.
Sign In or Register to comment.