views:

85

answers:

4

First of all, whats the difference between:

www.domain.com

or

domain.com

Should I pay attention when I do the coding?

+4  A: 

I would highly recommend to use relative paths.

This has many advantages, for insance:

  • Paths are shorter
  • If you want to move to a different domainname you don't have to check through thousands of codelines

In genereal there IS a difference between: www.domain.com and domain.com. The "www" prefix is nothing more than an ordinary subdomain: http://en.wikipedia.org/wiki/Subdomain

Chris
what is relative paths?? is it the "../folder/file.php"??
Yes [Please enter at least 15 characters.]
Chris
thanks chris.....................
+2  A: 
domain.com

Is the registered domain and

www.domain.com

Is a sub-domain of domain.com, they are not alway the same. Most web sites will set up their webserver to redirect domain.com to www.doamin.com or vice versa.

Depending on the DNS Zone file configuration sub-domains can point to different IP addresses (possibly different physical servers).

example.com.  A     10.0.0.1              ; ip address for "example.com"
ns            A     10.0.0.2              ; ip address for "ns.example.com"
www           CNAME ns                    ; "www.example.com" is an alias for   "ns.example.com"
wwwtest       CNAME www                   ; "wwwtest.example.com" is another alias for "www.example.com"
mail          A     10.0.0.3              ; ip address for "mail.example.com", any MX record host must be

Taken form Wikipedia - DNS Zone File

rjstelling
A: 

Relative urls arnt the best idea. its a good idea to have one constant hold the value for a relative url and the rest to be static

A: 

Yes, you should always pay attention when coding.

David Schmitt