0

For some sites that have their backend on PHP/any other server side languages, the query string http://example.com/?param1=whatever makes sense. But I saw it is used with pages that have .html extension as well. How does that make sense? If we are explicitly writing the url to end in .html, it means it is referring to a file located on the server, and it is an HTML file, which cannot deal with server side stuff. So how does it make sense?

As an example, http://www.example.com/mypage.html?crcat=test&crsource=test&crkw=buy-a-lot1, this url is given on https://help.marketruler.com/wiki/What_is_the_correct_syntax_for_query_strings%3F link (under Landings to a page within your domain name with no query string).

user185887
  • 643
  • 6
  • 18

1 Answers1

0

There are two reasons:

  1. You can fetch the parameters with JavaScript and use them with client side programming

  2. You can change the Mime type of .html files and parse them as a PHP or other programming language script. For example in Apache to make html files to work like php scripts it is as simple as adding this to .htaccess file:

    AddType application/x-httpd-php .html

Philip Petrov
  • 975
  • 4
  • 8