Page redirection methods and redirection Methods

Source: Internet
Author: User

Page redirection methods and redirection Methods

Recently, in the development project, my colleagues used CMS templates to build websites, but they didn't want users to access template files.

I have come up with several methods for this question. I will share these methods with you below.

I hope everyone will make persistent efforts to contribute their own efforts to the program.

I'm not talking nonsense.

 

JS to achieve page redirection

First:

<Script language = "javascript" type = "text/javascript">
Window. location. href = "http://shanghepinpai.com ";
</Script>

Second:

<Script language = "javascript">
Alert ("return ");
Window. history. back (-1 );
</Script>

Third:

<Script language = "javascript">
Window. navigate ("http://shanghepinpai.com ");
</Script

Fourth:

<Script language = "JavaScript">
Self. location = 'HTTP: // shanghepin#.com ';
</Script>

Category 5:

<Script language = "javascript">
Alert ("illegal access! ");
Top. location = 'HTTP: // shanghepin#.com ';
</Script> meta tag implementation in html

You only need to add the following sentence to the head. After staying on the current page for 0.1 seconds, you can jump to the target page.

<Meta http-equiv = "refresh" content = "0.1; url = http://jb51.net/"> php implementation <? Php
Header ("Location: http://jb51.net /");
?>

 

 

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.