Forum Moderators: phranque

Message Too Old, No Replies

how does trailing slash gets added in the homepage?

         

an15h

9:14 am on Oct 30, 2010 (gmt 0)

10+ Year Member



in the forum [webmasterworld.com ] Status_203 tells that:

If I attempt to go to www.google.com in my browser then I end up at www.google.com/ . So where is this happening. Using Firefox with the Live HTTP Headers add on shows me making no request for www.google.com but immediately requesting www.google.com/ . So it looks like the browser recognises that www.google.com is not a valid url but realises that in this case what is actually wanted most often is the root path of the domain "/" and so defaults this part of the path just as it defaults the "http://" part.


there hasn't been any discussion on this after that. when i searched the net and [webmasterworld.com ] forums i didn't find an answer to this.

could you tell how this works in browsers?

the issues are:

1) when i type www.google.com in the address bar, the url automatically gets changed to www.google.com/. in most of the sites it's like the same. www.webmasterworld.com -> www.webmasterworld.com/

the Live HTTP Headers add on of firefox shows that the page requested is www.google.com/
there is no request for www.google.com shown.

does this mean that firefox automatically adds the trailing slash for home pages/root directory and request for the homepage with trailing slash on?

2) how is it with other browsers?

3) is there a tool like "Live HTTP Headers add on in firefox" for other browsers that helps in showing the HTTP header details of the data sent and received?

[PS: it's not the trailing slash problem for directories that is mentioned here, only trailing slash in homepage/root directory]

sublime1

3:04 pm on Nov 2, 2010 (gmt 0)

10+ Year Member



an15h -- the trailing slash is added by the web server, not the browser. A redirect is a special response code (301 or 302, usually) that a web server can send back which is a direction to the browser to re-request the page using the URL provided in the Location header returned in the response.

There are many ways the web server or the web page being returned could decide to return the redirect response.

It has nothing to do with the browser, other than the browser is responding properly to the command of the web server.

g1smd

4:18 pm on Nov 2, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



See my answers in [webmasterworld.com...]