The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS [Solved] Protect css file with PHP Re: [Solved] Protect css file with PHP


Sorry for making a comment on a very old thread.

I just wanted to point out a reason I had to secure my CSS files.

Basically, in a nutshell I had a group in Egypt which created a phishing site of one of my client’s sites. They were dumb enough or simply too lazy to copy and paste my CSS styles, so in stead they linked directly to my CSS files.

So I simply changed the path of my application to look at a new path and changed the styles they were using to have:

body:before {
content: 'This website is a scam!';

body {
display: none;

Then to stop them from doing it again, I used PHP to generate my styles and used the $_SERVER against a static array of domains I setup in the file.

You can see the rest of the article and code here:

Notice at the bottom I mention firebug and javascript.

Just as most of the guys on here say, it’s really not a major thing, however in my case I had to do something about it and quick! I was just lucky they were trying to access my CSS directly.