Home >Web Front-end >HTML Tutorial >Does a URL with parameters point to the parameters behind a static file have any effect? _html/css_WEB-ITnose

Does a URL with parameters point to the parameters behind a static file have any effect? _html/css_WEB-ITnose

WBOY
WBOYOriginal
2016-06-24 12:12:371496browse

http://127.0.0.1/index.html?param1=asdfasdf¶m2=asdfasdfa

Can param1=asdfasdf¶m2=asdfasdfa be ignored?


Reply to the discussion (solution)

It depends on whether these two parameters are meaningful for this static file (whether these two parameters are used in the static file parameter).

It depends on whether these two parameters are meaningful to this static file (whether these two parameters are used in the static file).

In general?

Generally speaking, adding a dynamically changing parameter to a static file can prevent browser caching.

Static web pages are rarely used in this way because they are not dynamic, but not necessarily.

If you use Ajax, you can use js to get the url parameters, and then $.post() to get the information.

Try:

<script> alert(location.search.substring(1));</script>

If you use url rewriting, you can also define some seemingly unnecessary parameters

If I When writing a WEB server, can you ignore the parameters of static files?

Did you write the cgi yourself?

Write WEB server.

is a general static file. If it has parameters, I don’t know whether to process it or ignore it.

It may be pseudo-static

If it is pure static html, js can also be simulated and obtained. For example, qq space is the most classic

Then there is anti-caching, which is generally The following parameters are random

Pseudo-static should not be included in this list.

For example:

http://xxx.xxx/main.aspx?bid=5&uid=12345

Using url rewriting, it may become like this:

http://xxx.xxx/5/12345/main2.html

Using url rewriting, don’t you just want to avoid those ugly url parameters?

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn