PHPCMS9 Add 301 Jump

Source: Internet
Author: User

"Error 310 (net::err_too_many_redirects): Too many redirects were encountered while doing 301 jumps. "The problem, small series here to deal with a simple way to write out hope can help everyone, the other small also put Phpcms V9 set 301 Jump Two aspects respectively to introduce you.

Phpcms v9 301 Jump Set Method One:

Only Apache server settings are supported

Locate the. htaccess file in the root directory and write the following code into it, and save the upload is set successfully, as

  

The code below, after copying directly, change the domain name can

Rewriteengine on

Rewritecond%{http_host}!^linchangbing.com$ [NC]

Rewriterule ^ (. *) $ http://linchangbing.com/$1 [l,r=301]

Note that the above domain name is replaced by your own domain name Oh, and the above code is the WWW domain name to jump to the domain name without www, if you are the preferred domain name with www, then the above code plus www. Expand reading: Phpcms v9 after setting 301, the inside page turns to the dynamic link

Phpcms v9 301 Jump Setting Method Two:

Another way to Phpcms v9 301 Jump Settings is to set it in the index.php file under the root directory, as

  

The code below, after copying directly, change the domain name can

$the _host = $_server[' http_host '];//get the current domain name

if (Strtolower ($the _host)! = ' linchangbing.com ')//change the domain name here to the one you want

{$URIRedirect =$_server[' Request_uri ');//Parameters after getting the domain name

if (Strtolower ($URIRedirect) = = "/index.php")//The argument is that the parameter is/index.php displayed AS/

{

$URIRedirect = "/";

}

Header ("http/1.1 301 Moved permanently");//301 head issued

Header ("location:http://www.linchangbing.com". $URIRedirect);//jump to the address format you want

Exit ();

}

"Error 310 (net::err_too_many_redirects): Too many redirects. "Problem

:

  

The solution is simple, that is, directly after the site's cache to regenerate the line. Recommended reading: How to choose a space

Above is "Phpcms v9 how to set 301 Jump", pro-test, can be resolved.

Reprint: http://www.linchangbing.com/show-15-23-1.html

Phpcms9 Add 301 Jump

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.