Web site construction, often encounter the need for Web page redirection situation:
1. Site adjustment, such as changing the Web page directory structure, the page was moved to a new address.
2. Web page extension changes, such as application needs
: This article mainly introduces the rewrite commands break, last, redirect, and permanent in Nginx. if you are interested in PHP tutorials, refer to them. Reprinted from: rewrite command (break, last, redirect, permanent) in Nginx)
Rewite
In the
Permanent page removal (301 redirects ) is a very important "auto-steering" technology. One of the most feasible ways to redirect URLs. When a user or a search engine makes a browse request to the Web server, one of the status codes in the header
Linux Nginx 301 Redirect Jump method Summary, there is a need for friends to refer to.
The first case: access to the AAAAAAA station directed to the BBBBBBBBBBB station
Copy Code code as follows:
server {
Server_naaaaaaame
In the server 301 and 302 for the search engine is a permanent jump new address, one is to tell you temporarily to a new address, then we in PHP How to implement the 301 permanent Redirect and 302 temporary redirect, let's look at the method
301 permanent redirection has no adverse effect on Seo, And the keyword ranking and PR level of Web Page A will be sent to web page B. If the website has changed its domain name, the website will be permanently transferred to another address, for
In the server, 301 and 302 are a permanent jump address for the search engine, and one is to tell you that a new address has arrived, so how can we implement 301 permanent redirection and 302 temporary redirection in php? let's take a look at the
Permanent Redirect of php301 to Apache and IIS
Header ("HTTP/1.1 301 Moved Permanently ");
Header ("Location: http://www.example.com/newpage ");
Exit;
?>
PHP 301 for IIS:
301 permanent redirection has no adverse effect on Seo, And the keyword ranking and PR level of Web Page A will be sent to web page B. If the website has changed its domain name, the website will be permanently transferred to another address, for
Permanent page removal (301 redirects) is a very important "automatic steering" technology.
First, give a tool to detect server header information, simply to see if your site 301 is successful. Do not underestimate this 301, if you are made into 302
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.