Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
In the following URL the New York Times uses a "?" after the .html file

I always thought that that was a query to a server - however in some of the
articles on their page some have the straight .html extension while others
have the one featured below:


If any experts can offer explanations I would appreciate it.
Thank you.

Re: ? URL

tony ritter wrote:

Quoted text here. Click to load it

It's still likely to be server side. Server side scripts can have any
extension you like, so long as you have setup your server to handle them
that way. For example, our Apache server here uses both HTM and JSP
extensions depending where in the site you are, but both file types are
actually server-side scripts (jsp, or servlets). The same goes for ASP -
you could have the ASP engine (IIS) parse .HTM files if you wanted.

You can also use javascript to read the data in the address bar (known
as a query string) - so you could have a client side form post to a page
(mypage.htm?blah=abc) and use JS on mypage.htm to read the querystring
and do something with it... not recommended as it'd fail with JS turned


x theSpaceGirl (miranda)

# lead designer @ http://www.dhnewmedia.com #
# remove NO SPAM to email, or use form on website #

Re: ? URL

SpaceGirl wrote in message:

Quoted text here. Click to load it
Thank you for the explanation but I was wondering why they used regular
.html URL extensions for many of their articles on their site - however
_other_ articles on their main page have a  "?" after the .html as in the
URL  described in the first thread.

Please advise if you get a chance.
Thanks for your time.

Re: ? URL

On Wed, 01 Sep 2004 09:31:22 -0400, tony ritter wrote:

Quoted text here. Click to load it

It could be any one of a number of reasons.  But pretty much everything
after the question mark is CGI stuff being sent to the server.

Keep in mind that the URL you see in your browser need not have *anything*
to do with the "real" path to the server-side files or applications, or
the "real" URL that is being served. Is is possible to have extremely
complicated URL rewriting to create virtual directories, virtual
applications, virtual servers, etc.

For example, my "main" web server uses Apache's mod_rewrite for ALL of
its URLs.  There is no way for *you* to tell, though.

actually gets rewritten to

But it used to get rewritten to:

All the average surfer will ever see is the first URL, though.

For more info on mod_rewite, browse this:

I don't know how IIS or iPlanet or other Web Servers do their rewriting,
but I am quite certain there are similar URL rewriting plug-ins for
other Web Servers thatn Apache.

there you go, more info than you need! later...

    Jeffrey D. Silverman | jeffreyPANTS@jhu.edu **
                 Website | http://www.newtnotes.com

(** Drop "pants" to reply by email)

Re: ? URL

Quoted text here. Click to load it

Thank you Jeffrey.

However, in the following URL, it would seems that whatever server side
language is being used there is a key - or name - value pair being used


select // the variable name within the server side script being parsed
page1 // the value

whereas in the New York Times example there was no name value pair after the
? just:


as in:


Please advise if you get a chance.
Thank you.

Re: ? URL

*tony ritter* wrote in alt.html:
[Query on URIs without querystring keys, only values]

If the programmer of that area of the site has decided that there will
only ever be one querystring key required, then that key can be
redundant in the URI and omitted if the programmer wishes it to be. A
plain ASP JScript example of how it could be used might be:

var strAdCampaign = Request.QueryString.Count ?
trim(Request.QueryString.Item) : "";

switch (strAdCampaign.toUpperCase()) {
   case "HP"    : GetCampaign("HP"); break;
   case "DELL"    : GetCampaign("DELL"); break;
   case "INTEL"    : GetCampaign("INTEL"); break;
   default    : GetCampaign_Default();

However, as previously mentioned the URI could be completely virtual
with no physical files or directories behind it. An example here might
be that all directories, files and querystring data after the domain
part of the URI are simply parameters for one server-side script, and
could be re-written on the fly from:


If you really want to know the programmers intentions you'd have to ask
them directly!
Andrew Urquhart
- FAQ: http://www.html-faq.com
- Archive: http://www.google.com/groups?q=alt.html
- Contact me: http://andrewu.co.uk/contact /

Re: ? URL

On Wed, 01 Sep 2004 16:00:38 +0000, Andrew Urquhart wrote:

Quoted text here. Click to load it

Right.  The point, Mister OP (tony ritter), is that there is really no way
to tell what is going on behind the scenes.

All data that is after the question mark arrives at the server in the
server environment variable QUERY_STRING. (this is an oversimplification).

The programmer can do whatever she wants with the string.

Why don't you write the NY Times webmaster and see if they will tell you
what is going on? They probably won't, but they might.  *I* would, if
someone wrote me (and I have received similar emails in the past).

    Jeffrey D. Silverman | jeffreyPANTS@jhu.edu **
                 Website | http://www.newtnotes.com

(** Drop "pants" to reply by email)

Re: ? URL

Quoted text here. Click to load it

Lots of server-side scripts treat the query string (everything after
the ? [1]) as a set of name/value pairs. However, it's quite
acceptable to treat it as a string.

So those two URLs could be treated as having query strings of
"select=page1" and "hp" respectively.

[1] Simplification: If there's a # after the ?, everything between the
? and the #


Site Timeline