Forum Moderators: coopster
I'm running a WordPress site that, unfortunately, has an issue: someone is stealing my stylesheet. I've done the whole "cease and desist" thing, but they aren't. Basically, their file is linking *directly* to my stylesheet - not only stealing my code, but also my bandwidth.
Now, when this is done with images, I can simply replace the image, and give *my* site the new filename. however, with WordPress, you can't do that. The file *has* to be named "style.css".
So what I'm attempting to do is us a combination of a dynamic stylesheet and @import. My style.css file has "@import url('newstyle.php')"
"newstyle.php" is *supposed* to have a hceck: if the site using the stylesheet is mine, then display correctstyle.css... but if the site using the stylesheet is *not* my site, then display "funstyle.css".
My issue is this: I can't figure out how to check if the site is mine or not. Use of $_SERVER['HTTP_HOST'] (and similar) returns the host of the *script* - which *is* my site, therefore it comes back as valid. This will not do. Is there a way to check the domain name of the site's server *without* using the source of the script?
Before you say anything - yes, I know I could probably prevent the whole thing with .htaccess. But dang - where's the fun in that?
Hope it helps :)
Actually, Id' tried that. The Referrer is the legtimate site. I *think* the reason is because I'm @import-ing the script in the css file, so the referer *is* the legitimate site (of that makes any sense?) The file, however *has* to be named "style.css" - so I can't change it to "style.php" or anything.
However, this line of thinking has given me an idea... I think if I make "style.css" just blank, then the problem is basically solved. Then I can call in a different stylesheet to pull in the actual styles on my site. I could even make *that* one the .php styleshet, and then the referer won't be the originating site, just in case they try another level of theft :)
Dang - such a simple solution LOL - sometimes I need to drink more coffee in the morning.