1

My site isn't loading any of the CSS or JS files in the head all of a sudden. When I go to view source and click on any of the CSS or JS files, I get the below code instead of the actual CSS or JS.

I have tested this on multiple browsers and multiple computers, and the problem doesn't seem to be very consistent either. Sometimes it loads, sometimes it doesn't, even after clearing the cache. It also seems to happen when adding the "www" before the URL, and sometimes it happens when you remove the "www".

I am completely stumped here as I hadn't uploaded any changes to the code when the problem started to occur. Any ideas what may be going on?


The code I'm getting instead of the CSS or JS code when viewing the source code:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta http-equiv="Content-Script-Type" content="text/javascript">
<script type="text/javascript">
function getCookie(c_name) { // Local function for getting a cookie value
    if (document.cookie.length > 0) {
        c_start = document.cookie.indexOf(c_name + "=");
        if (c_start!=-1) {
        c_start=c_start + c_name.length + 1;
        c_end=document.cookie.indexOf(";", c_start);

        if (c_end==-1) 
            c_end = document.cookie.length;

        return unescape(document.cookie.substring(c_start,c_end));
        }
    }
    return "";
}
function setCookie(c_name, value, expiredays) { // Local function for setting a value of a cookie
    var exdate = new Date();
    exdate.setDate(exdate.getDate()+expiredays);
    document.cookie = c_name + "=" + escape(value) + ((expiredays==null) ? "" : ";expires=" + exdate.toGMTString()) + ";path=/";
}
function getHostUri() {
    var loc = document.location;
    return loc.toString();
}
setCookie('YPF8827340282Jdskjhfiw_928937459182JAX666', '210.92.81.251', 10);
try {  
    location.reload(true);  
} catch (err1) {  
    try {  
        location.reload();  
    } catch (err2) {  
        location.href = getHostUri();  
    }  
}
</script>
</head>
<body>
<noscript>This site requires JavaScript and Cookies to be enabled. Please change your browser settings or upgrade your browser.</noscript>
</body>
</html>
6
  • 3
    What does YOUR HTML look like? How are you loading things into the page? are you sure you are referencing the correct files? did anyone move the files from your server? Did anyone rename files in your server? Are there any console errors? because if it failed to load your JS or CSS it would produce an error. You need to show some basic debugging... Commented Sep 14, 2016 at 14:22
  • Clear your cache? Commented Sep 14, 2016 at 14:24
  • Who is your web host? How are you viewing your files? What OS/browser/version? How can we possibly reproduce your problem? Commented Sep 14, 2016 at 14:25
  • 1
    It's got to be a server side error or maybe your server got compromised. Commented Sep 14, 2016 at 14:29
  • Well the weird part is that none of the files have been changed. It was working fine, and then all of a sudden it broke. It also can't be replicated consistently, as it will randomly fix itself. It can be fixed on one browser, while broken on another, or fixed on one computer, and then broken on another. Caches have been cleared, and sometimes this fixes the problem, and sometimes it causes it. So it doesn't seem to be a factor here. Commented Sep 14, 2016 at 14:45

2 Answers 2

3

I guess it is some malware on your computer. If you search for the cookie string YPF8827340282Jdskjhfiw_928937459182JAX666 you get a lot of results on google.

This forum post has the same source code as you: http://www.bleepingcomputer.com/forums/t/515669/possible-hijacking/

Or do you display ads on your site?

Edit: Can you post your site? Either your computer our your site might be infected.

Sign up to request clarification or add additional context in comments.

Comments

0

OK, so turns out, the hosting company triggered a security feature that temporarily broke a lot of the site. Everything is back to normal now. Thanks everyone for your input!

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.