Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Web Programming > HTML > HTML Code Clinic
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
HTML Code Clinic Do you have some HTML code you'd like to share and get suggestions from others for tweaking or improving it? This discussion is the place.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the HTML Code Clinic section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old August 9th, 2004, 03:27 AM
Friend of Wrox
 
Join Date: Mar 2004
Location: Bhopal, MP, India.
Posts: 357
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to anshul
Default http://domain or http://www.domain

[this may not be an html question]

what should we practise:
http://domain or http://www.domain

99% websites i see, use http://www.domain
what's the difference from http://domain
__________________
`~@#\^%&*/\.<.\/-|+|_!:;..=?>
PHP, SEO | anshul shrivastava | mediasworks.org | FB
Reply With Quote
  #2 (permalink)  
Old August 9th, 2004, 07:04 AM
Friend of Wrox
Points: 2,473, Level: 20
Points: 2,473, Level: 20 Points: 2,473, Level: 20 Points: 2,473, Level: 20
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: May 2004
Location: India
Posts: 642
Thanks: 0
Thanked 43 Times in 42 Posts
Default

You should use :
http://www.domain.com

If you specify http://domain, I think browser converts this into http://www.domain.com

Please check the following article:

http://webtips.dan.info/url.html




Om Prakash
Reply With Quote
  #3 (permalink)  
Old August 9th, 2004, 07:43 AM
Friend of Wrox
 
Join Date: Mar 2004
Location: Bhopal, MP, India.
Posts: 357
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to anshul
Default

Browsers do not convert http://domain to http://www.domain
Reply With Quote
  #4 (permalink)  
Old August 9th, 2004, 08:21 AM
Friend of Wrox
Points: 2,473, Level: 20
Points: 2,473, Level: 20 Points: 2,473, Level: 20 Points: 2,473, Level: 20
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: May 2004
Location: India
Posts: 642
Thanks: 0
Thanked 43 Times in 42 Posts
Default

I think it depends on browser and it's version.

Om Prakash
Reply With Quote
  #5 (permalink)  
Old August 9th, 2004, 11:15 AM
richard.york's Avatar
Wrox Author
Points: 5,506, Level: 31
Points: 5,506, Level: 31 Points: 5,506, Level: 31 Points: 5,506, Level: 31
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Camby, IN, USA.
Posts: 1,706
Thanks: 0
Thanked 6 Times in 6 Posts
Default

Whether the 'www' is available as an option depends on the HTTP server not the browser. It doesn't matter which one you use. If you are coding file paths that point to the same website, personally I would strive to always use relative paths that do not include the domain portion of the URL.

Examples of relative paths:

/path/from/www/root/file.html

file_in_same_directory.html

directory_in_same_folder_as_file_referencing_it/file.html

../go_one_directory_up_to_find_this_directory

Why is domain abstraction a good thing? What if the domain is changed? Made into a sub domain? Renamed all together? Domain mirrors added? Relative paths make transitions like these easier.

That's just my opinion.

HTH!

Regards,
Rich

--
[http://www.smilingsouls.net]
[http://pear.php.net/Mail_IMAP] A PHP/C-Client/PEAR solution for webmail
Reply With Quote
  #6 (permalink)  
Old August 10th, 2004, 02:45 AM
Friend of Wrox
 
Join Date: Mar 2004
Location: Bhopal, MP, India.
Posts: 357
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to anshul
Default

ricard, with ur reply i got another question2ask (that i've asked at many places but found no satisfactory answer; i m not sure, but i merely put this question here now)

how can we use relative links in subdomains
i mean using relative links we can't jump out of a subdomain folder
httpd.conf scheme generally maps subdomains as for e.g., http://subdomain.domain not as http://domain/subdomain

though subdomain folders are in public_html just like other folders
we can't edit remote httpd.conf file; can some .htaccess trick let us achieve relative urls in our subdomains folders ?

and4om prakash,i would say http://domain would not map to http://www.domain unless we do cannonical names setting in a .htaccess file (Apache/Linux)
it is a good practice to let requests served by both http://domain and http://www.domain both but it is still better to convert http://www.domain request to http://domain or vice-versa

as an example i've seen listings of many websites in search-engines; i found http://php.net instead http://www.php.net ! surpise !
though practically all host use http://www.domain
any satisfactory answer for that extra 'www' ?
just a convention ?
Reply With Quote
  #7 (permalink)  
Old August 10th, 2004, 03:16 AM
Friend of Wrox
 
Join Date: Jul 2003
Location: , , United Kingdom.
Posts: 683
Thanks: 0
Thanked 1 Time in 1 Post
Default

Hi Anshul,

AFAIK the prefix "www" is in fact a sub domain itself, but in general is normally used to represent the default web server of a domain.

Additional sub domains are often configured with appropriate prefixes - "ftp" being a classic for ftp servers, but others give a hint of the content of a web (or other) server, e.g. news.bbc.co.uk, you can use what you want, but it's a nice touch if it's meaningful :).

HTH,

Chris

Reply With Quote
  #8 (permalink)  
Old August 10th, 2004, 03:24 AM
Friend of Wrox
 
Join Date: Mar 2004
Location: Bhopal, MP, India.
Posts: 357
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to anshul
Default

yup! thatz the satisfactory answer
i also hope someone would answer the first portion of my previous reply
Reply With Quote
  #9 (permalink)  
Old August 10th, 2004, 08:12 AM
Friend of Wrox
Points: 1,315, Level: 14
Points: 1,315, Level: 14 Points: 1,315, Level: 14 Points: 1,315, Level: 14
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: , , .
Posts: 425
Thanks: 0
Thanked 3 Times in 3 Posts
Default

Again? :D

Look anshul, it simply doesn't work the way you want. The document root directory, that's as far as the browser is allowed to go. It cannot resolve a relative URL that goes above that.

Relative URLs that cross domain borders, how do you mean that would work anyway? If the browser *could* jump down that other folder how would it know the relative URL all of a sudden should resolve to another domain?

(o<
//\ =^..^=
Reply With Quote
  #10 (permalink)  
Old August 11th, 2004, 01:09 AM
Friend of Wrox
 
Join Date: Mar 2004
Location: Bhopal, MP, India.
Posts: 357
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to anshul
Default

i've found traces2support my argument in webmasterworld forums; this is can be done by writing certain lines2httpd.conf file (Apache); probably there is some .htaccess trick also4us - i hope i'll -n- we'll find it out.

Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Same pages for sub domain from main domain vivek_inos ASP.NET 1.0 and 1.1 Professional 1 February 13th, 2007 10:15 AM
Web part functionality like http://www.thefreedict kamii47 ASP.NET 2.0 Professional 0 June 10th, 2006 01:36 AM
http://mysite.com or http://www.mysite.com anshul HTML Code Clinic 1 December 27th, 2004 03:50 PM
C++ Books http://www.gotchas3.as.ro inrev C++ Programming 1 January 21st, 2004 03:50 AM
C++ Books http://www.gotchas3.as.ro inrev All Other Wrox Books 0 January 16th, 2004 01:14 PM



All times are GMT -4. The time now is 07:49 AM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.