In previous articles, we have discussed several main aspects of URL Rewrite. In the last article of this series, we will discuss some details and features about different levels of URL Rewrite.
Theoretically, IIS-level URL Rewrite is written in C or C ++, which is better than ASP. NET-level URL Rewrite written in mana
This article mainly introduced the Nodejs realization obtains the current URL address and the URL various parameter values, this article directly gives the code example, needs the friend to be possible to refer to under
The code is as follows:
Module HTTP URL that needs to be used
Current URL http://localhost:8888/s
1.URL special characters need to be escaped2. Replace the space with a plus sign (+)3. Forward slash (/) separator directory and subdirectories4. Question mark (?) Separating URLs and queries5. Percent semicolon (%) to develop special characters6. #号指定书签7. Number Separator parameter
Reason to escape character:
If your form is submitted using the Get method, and the submitted arguments have special characters such as "", if you do not do so, you will
The code is very simple, the main idea is to parse the URL parameters to JS object, and then do add, delete, change, check the operation is very convenient ~, take notes here.
Copy Code code as follows:
var lg= (function (LG) {
var objurl=function (URL) {
this.ourl=url| | Window.location.href;
This.href= ""; the front part
This.params={};//
JS get the Routing URL address, the equivalent of PHP $_server[' Http_referer '. Methods: Using JS to obtain the routing URL address can accurately judge the true antecedents of the Web page. At present, Baidu Statistics, Google Ads statistics, CNZZ Statistics, are used this method. Anti-Theft chain is also very simple, JS to determine the routing URL if not the
As a front-end, daily dealing with URLs is essential. But maybe every day is just a simple use, it is just smattering, with the work, I found in the daily grab package debugging, interface calls, browser compatibility and many other aspects, do not go deep to understand the URL and URL coding will step on a lot of pits. So write down this article and explain the URL.URL and URIMany people will confuse these
Php retrieves the current url and replaces the parameter or url. First, PHP retrieves the URL of the current page: Copy the code as follows: get the current script URL functionGetCurUrl () {if (! Empty ($ _ SERVER [REQUEST_URI]) {$ scriptName $ _ SERVER [1. PHP obtains the URL
As a front-end, daily dealing with URLs is essential. But maybe every day is just a simple use, it is just smattering, with the work, I found in the daily grab package debugging, interface calls, browser compatibility and many other aspects, do not go deep to understand the URL and URL coding will step on a lot of pits. So write down this article and explain the URL
Hot Key URL:
Simple understanding is the URL that can be accessed quickly. You can visit your own set of shortcut URLs by pressing the shortcut key (F1-F12).
For example, you can customize the F1 key to se.360.cn, and any time you press F1, you can quickly access se.360.cn
URL alias:
The Address bar to enter the shortcut words, you can access its correspondin
How to get the current page URL (URL) and query parameters
Get the current page URL (URL) and query parameters in JavaScript.Sometimes we need to get the URL parameters for the current page on the client, and you probably know that it's easier to get it on the server side,
After the URL rewrite, the problem that is often encountered is that the postback destination address in the page is not the address that the client requested, but the address after the URL rewrite. For example, rewrite in one of the previous articles:
When the user requests "/USER/JEFFZ", the code appearing on the page is
The intent of this line of code is so obvious that it modifies the form's ac
Copy Code code as follows:
Module HTTP URL that needs to be used
Current URL http://localhost:8888/select?aa=001bb=002
var http = require (' http ');
var URL = require (' URL ');
Http.createserver (function (req, res) {
var arg = Url.parse (req.url). query; Method one arg => aa=001bb=002
var arg =
The following code outputs a URL that is
Http://localhost:8080/news/HelloServlet?hello=%e5%a4%a7%e5%ae%b6%e5%a5%bdtest=%e5%a4%a7%e5%ae%b6%e5%a5%bd
HTML code
Value= "Http://localhost:8080/news/HelloServlet" var= "url"
>
Name= "Hello" value= "${hello}"
/>
Name= "Test" value= "${hello}"
/>
href= "/>"
>${hello}
,url提交汉字乱码">,
First, extract the parameters from the URL
There are the following strings:
var linkurl = ' http://localhost:8080/String/string_6.html nickname = small Xishan son age=24#id1 ';
For a real URL address, you can use JS to read the relevant information in location to obtain some information, listed below:
Copy Code code as follows:
Location.origin:http://localhost "Domain"
Location.pathname:
Whether front-end development or background design, many times developers need to get information about the current or target URLs. This existing built-in object attribute can be invoked directly (here is the reference code to get the current page)
Copy Code code as follows:
But sometimes we need to change the current URL of the parameters/parameter values, at this time what people will handle it? In general, you should make a
First, PHP retrieves the URL of the current page:
CopyCode The Code is as follows: // obtain the current Script URL
Function getcururl ()
{
If (! Empty ($ _ server ["request_uri"])
{
$ Scriptname = $ _ server ["request_uri"];
$ Nowurl = $ scriptname;
}
Else
{
$ Scriptname = $ _ server ["php_self"];
If (empty ($ _ server ["QUERY_STRING"])
{
$ Nowurl = $ scriptname;
}
Else
{
$ Nowurl = $ scriptname ."? ". $
First, PHP retrieves the URL of the current page:Copy codeThe Code is as follows:// Obtain the current Script URLFunction GetCurUrl (){If (! Empty ($ _ SERVER ["REQUEST_URI"]){$ ScriptName = $ _ SERVER ["REQUEST_URI"];$ Nowurl = $ scriptName;}Else{$ ScriptName = $ _ SERVER ["PHP_SELF"];If (empty ($ _ SERVER ["QUERY_STRING"]){$ Nowurl = $ scriptName;}Else{$ Nowurl = $ scriptName ."? ". $ _ SERVER [" QUERY_STRING "];}}Return $ nowurl;} The other is to r
How to access PHP Through URL to get a new URL [call Baidu Map] I want to perform a navigation on my mobile phone
If the URL address of the current navigation is entered into the IE address bar can be accessed normally: http://api.map.baidu.com/direction? Origin = latlng: 24.481428, 118.124813 | name: Test start point destination = latlng: 24.503361, 118.139877
The obtained URL is a complete URL, which contains the QueryString part.String url = Request. Url. ToString ();Retrieve domain name: The code is as follows:Copy code String url = HttpContext. Current. Request. Url. Host;
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.