Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Web Programming > HTML > HTML Code Clinic
|
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 software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 9th, 2004, 03:27 AM
Friend of Wrox
 
Join Date: Mar 2004
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
 
Old August 9th, 2004, 07:04 AM
Friend of Wrox
 
Join Date: May 2004
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
 
Old August 9th, 2004, 07:43 AM
Friend of Wrox
 
Join Date: Mar 2004
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
 
Old August 9th, 2004, 08:21 AM
Friend of Wrox
 
Join Date: May 2004
Posts: 642
Thanks: 0
Thanked 43 Times in 42 Posts
Default

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

Om Prakash
 
Old August 9th, 2004, 11:15 AM
richard.york's Avatar
Wrox Author
 
Join Date: Jun 2003
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
 
Old August 10th, 2004, 02:45 AM
Friend of Wrox
 
Join Date: Mar 2004
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 ?
 
Old August 10th, 2004, 03:16 AM
Friend of Wrox
 
Join Date: Jul 2003
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

 
Old August 10th, 2004, 03:24 AM
Friend of Wrox
 
Join Date: Mar 2004
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
 
Old August 10th, 2004, 08:12 AM
Friend of Wrox
 
Join Date: Jun 2003
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<
//\ =^..^=
 
Old August 11th, 2004, 01:09 AM
Friend of Wrox
 
Join Date: Mar 2004
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.






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





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.