Homepage sometimes can't load style

Source: Internet
Author: User
Homepage sometimes can't load style
This post was last edited by yang131261 on 2014-08-15 18:17:14

Do a site, the home page has a cache sometimes open when the path of the style is such an IP address/CSS/INDEX.CSS home style disorderly This site started with ip:8080 access to bind the domain name after the domain access but sometimes the style or the loaded IP's clear cache after the style of the path to change the domain name /CSS/INDEX.CSS home style is normal. The cache for the home page is in the file cache

The path to the style is based on the function obtained by the


function Get_http ()
{
return isset ($_server[' https ") && strtolower ($_server[' https"])! = ' off '? ' https://': '/HTTP ';
}
function Get_domain ()
{
$protocol = Get_http ();
if (Isset ($_server[' http_x_forwarded_host ')) {
$host = $_server[' http_x_forwarded_host ');
} elseif (Isset ($_server[' http_host ')) {
$host = $_server[' http_host ');
} else {
if (Isset ($_server[' Server_port ')) {
$port = ': '. $_server[' Server_port '];
if (': "= = $port && '/http ' = = $protocol | | ': 443 ' = = $port && ' https://' = = $protocol) {
$port = ";
}
} else {
$port = ";
}
if (Isset ($_server[' server_name ')) {
$host = $_server[' server_name '). $port;
} elseif (Isset ($_server[' server_addr ')) {
$host = $_server[' server_addr '). $port;
}
}
Return $protocol. $host;
}

------Solution--------------------
Will your website switch between HTTP and HTTPS?
Only need to generate a full URL if a switchover occurs

When you are 12 lines, what is the code for the processing port to be executed? ($_server[' http_host ') is always present.
Processing ports (port) and processing HOST are parallel and should not be placed in the Else branch
  • 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.