How to jump to. htaccess. Determine whether any keyword such as & nbsp; Google & nbsp; exists in the url, and then jump to the new url. If no keyword is displayed, open it normally? Can this be implemented? It's a little white. I'm asking for help. How to jump to. htaccess.
Determine whether there are Google and other keywords in the origin url, and then jump to the new url.
If no keyword is displayed, open it normally?
Can this be implemented?
It's a little white. I'm asking for help. . Htaccess shared:
------ Solution --------------------
Your purpose can be achieved through anti-Leech protection of the http protocol.
If (isset ($ _ SERVER ['http _ referer']) {
// Judge whether $ _ SERVER ['http _ referer' has a google
// If yes, the website is used. if not, the website is not used,
If (stristr ($ _ SERVER ['http _ referer'], "google") === false ){
Header ('Location: correct url. php ');
} Else {
// Jump to the warning page
Header ('Location: warning. php ');
}
} Else {
// Jump to the warning page
Header ('Location: warning. php ');
}
If you must pass. to implement htacess, you can take a look at the PHP video tutorial of Chuanzhi podcast. The core technology of PHP large portal website-static 8 (using apache rewrite mechanism to implement pseudo-static page 1 ), this knowledge point is also mentioned in it.
------ Solution --------------------
Apache anti-Leech
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