0

Correct me if I am wrong but if you see a ? in a URL then it means the following are arguments for PHP or whatever language the developer/server is using. At least in PHP those are GET arguments and I was under the impression that you are not be able to do that in HTML or CSS. I know that by having it will not break the web address but I'm more so wondering why. Why are there ? arguments on .html/.htm files if you can't include any dynamic page code (except CSS percentages)?

Also let me know if this is a stupid question and I'll get it out of everyones way! :-P

rcobelli
  • 199
  • 1
  • 2
  • 14
  • Sometimes they just use the HTML extension to mean that the final result is HTML, the file on the backend is not necessarily static. – Qantas 94 Heavy Jan 14 '15 at 03:06
  • Ok, thank you @Qantas94Heavy . Go ahead and post that as an answer and I'll mark it as accepted if you want those points ;-) – rcobelli Jan 14 '15 at 03:08
  • 1
    I'm too lazy, accept the other person's post :P – Qantas 94 Heavy Jan 14 '15 at 03:09
  • 1
    Query strings on static files are often used for cache busting. – Musa Jan 14 '15 at 03:14
  • i would you say your confusing a file extension (part of the name) and a file type - *.html could be a valid gif image. –  Jan 14 '15 at 03:17
  • You should **definitely** read some tutorials and/or articles on the topic first. This is "basic web development 101" and you shouldn't post here, it's Q&A on specific problems. – Julian F. Weinert Jan 14 '15 at 03:42
  • I'm not as much of a noob as I may seem with this question :-P @Julian. I don't know Javascript and am not claiming to be an expert but I'm not completely clueless when it comes to web development. :-) – rcobelli Jan 14 '15 at 04:24
  • Okay, that shouldn't rude or so :) Read some informations on HTTP, that should answer your questions. That has nothing to do with JavaScript. This is just HTTP, nothing more. – Julian F. Weinert Jan 14 '15 at 14:25

2 Answers2

1

Several possible reasons:

GET arguments can be retrieved from Javascript (e.g. How to retrieve GET parameters from javascript?)

The html extension does not tell you anything about how the server works internally. Those html pages could have been generated dynamically, or the server could utilize the GET arguments while serving a static file. They will also occur in the logs, so someone with a very basic standard web server installation could still give people links with e.g. ?utm_source=twitter, etc. parameters to track where the clicks are coming from by looking at logs.

Community
  • 1
  • 1
L3viathan
  • 26,748
  • 2
  • 58
  • 81
1

For example Content-Managment-Systems (CMS) often use .html for their links. But Internally ist get redirectet to a PHP File who delivers the HTML Page

j_s_stack
  • 667
  • 1
  • 5
  • 18