Implementation of Automatic Webpage redirect: PHP, JSP (on)

Source: Internet
Author: User

Generally, the browser receives a webpage containing Code . This page may be converted on the server side. In this case, the browser only receives one page, and the automatic redirection usually means that the page received by the browser has the function of automatically sending access users to other pages.
The rational application of automatic redirection technology includes switching users to the webpage version of the specified browser, and transferring people to the new domain name after the website domain name is changed or deleted. However, this technology is often used by search engine optimizers as a way to improve the ranking of search engines on websites. For example, we first create a highly optimized webpage for the search engine, that is, the "bridge page" we usually call, and then submit the webpage to the search engine for a good ranking. However, when a Search user clicks the webpage list in the search result list of the search engine, the user is automatically directed to the website address that the user did not intend to visit. Search engines often think that a webpage that is automatically redirected is misleading to readers, so it will impose disciplinary actions on such webpages or websites. However, it cannot detect automatic redirection methods.
Meta Refresh tag Automatic Steering Method
Because the search engine can read HTML, and meta & nbsptags is also HTML, the search engine can automatically detect this automatic redirection method. Therefore, no matter what the website turns for, it is easy for search engines to mislead readers and be punished. However, if the jump delay time is set appropriately, the search engine will not regard it as cheating.
The Meta Refresh tag can only be placed in the Code Copy code The Code is as follows: <meta http-equiv = "refresh" content = "5" url = http://www.jb51.net/">

In this example, the browser automatically redirects to the page.htm page within five seconds. This method is often seen in forums. If a message is sent to the Forum, a confirmation page is displayed first. A few seconds later, the confirmation page is automatically redirected back to the current forum page.
From the perspective of search engine optimization, it is generally not necessary to automatically turn to a delay. However, if you use the Meta Refresh logo for redirection, you must set the delay time to at least 10 seconds.
"JavaScript" automatic redirection Method
Because JavaScript cannot be parsed, the search engine cannot detect (automatically detect) Automatic redirection using JavaScript scripts. The javascript automatic redirect script can be placed anywhere on the webpage. If you want to jump immediately, you can put it at the top of the Solution 1:
CodeCopy codeThe Code is as follows: <script language = "JavaScript">
<! --
Location. Replace ("http://www.jb51.net ");
-->
</SCRIPT>

the advantage of using JavaScript to implement automatic redirection is that the target URL accessed by the user is not retained in the history of the user's browser. If the user presses the return button to return, it will return to the webpage before the jump, instead of the jump page containing the Javascript automatic redirect script, so it will not appear when the user clicks the return button and returns to the redirect page, then the page automatically jumps to the page that the user originally wanted to leave.
if necessary, the Javascript automatic redirection script can be stored in an external file and loaded using the following command line, where "filename. JS "is the path and file name of the external file:
Code

Note: JavaScript scripts are usually used to implement instant redirection, or do not want people to see the page before redirection. In this case, place the Javascript script in the area of the HTML source code.
form automatic redirection
the search engine's "crawling" Program does not fill in the form, therefore, they do not notice the submission form, so they can use the form for automatic redirection without the search engine being aware of it.
for forms, it is seldom realized that the URL contained in the form action parameter is actually the URL requested by the browser to the server. The browser will add some parameters in the name = value format to the requested URL to give it special treatment. If nothing happens, the browser still sends a request to the server for the URL.
A Javascript script allows you to submit a form when loading a page. The following is an example of automatic form submission using JavaScript:
Code copy Code the code is as follows:

Related Article

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.